modulepackage
1.2.1
Repository: https://github.com/ngrsoftlab/ngr-emailer.git
Documentation: pkg.go.dev
# 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(
"[email protected]",
"password",
"[email protected]",
fmt.Sprintf("%v:%v", "test.com", "587"),
)
err := s.NewMessage(
&MessageParams{
Topic: "topic",
ContentType: HtmlContentType,
Charset: Utf8Charset,
Recipients: []string{"[email protected]"},
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)
}
# Functions
LoginAuth auth with login and password.
NewSender creating new *Sender obj.
TestLoginAuth - test smtp server login auth.
# Constants
Charsets.
Content types.
Content types.
Content types.
Charsets.
Content types.
# Structs
AttachData struct for attachments.
No description provided by the author
Sender struct - sender for sending smtp packs.