https://github.com/ngrsoftlab/ngr-emailer
Tiny lib for email (with attachments) sending
https://github.com/ngrsoftlab/ngr-emailer
Last synced: 5 months ago
JSON representation
Tiny lib for email (with attachments) sending
- Host: GitHub
- URL: https://github.com/ngrsoftlab/ngr-emailer
- Owner: NGRsoftlab
- License: mit
- Created: 2021-06-08T16:27:46.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2025-03-19T08:48:26.000Z (over 1 year ago)
- Last Synced: 2025-03-19T09:33:57.372Z (over 1 year ago)
- Language: Go
- Size: 21.5 KB
- Stars: 1
- Watchers: 5
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# emailer
Tiny lib for email (with attachments) sending (smtp, only login auth is supported now)
# import
```import "github.com/NGRsoftlab/ngr-emailer"```
# example
```
s := NewSender(
"user@mail.com",
"password",
"user@mail.com",
fmt.Sprintf("%v:%v", "test.com", "587"),
)
err := s.NewMessage(
&MessageParams{
Topic: "topic",
ContentType: HtmlContentType,
Charset: Utf8Charset,
Recipients: []string{"user@test.ru"},
Body: body,
Files: []AttachData{{
FileName: "test.txt",
FileData: []byte("test"),
}},
})
if err != nil {
log.Fatal(err)
}
err = s.Send()
if err != nil {
log.Fatal(err)
}
```