An open API service indexing awesome lists of open source software.

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

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)
}
```