Documentation ¶
Index ¶
- Constants
- Variables
- func WithAddressHeader(field, address, name string) func(*SendOption)
- func WithAlternativeBody(contentType string, content string, setting gomail.PartSetting) func(*SendOption)
- func WithBody(contentType string, content string, setting gomail.PartSetting) func(*SendOption)
- func WithCharset(charset string) func(*SendOption)
- func WithCopies(addresses ...string) func(*SendOption)
- func WithHeader(field string, values ...string) func(*SendOption)
- func WithInvisibleCopies(addresses ...string) func(*SendOption)
- func WithRecipients(addresses ...string) func(*SendOption)
- func WithSender(address string, name string) func(*SendOption)
- func WithSubject(subject string) func(*SendOption)
- type AddressHeader
- type Body
- type Header
- type Mailer
- type Option
- type OptionFunc
- type SendFunc
- type SendOption
Constants ¶
View Source
const ( ContentTypeHTML = "text/html" ContentTypeText = "text/plain" )
Variables ¶
View Source
var ErrUnexpectedEmailAddressFormat = errors.New("unexpected email address format")
Functions ¶
func WithAddressHeader ¶
func WithAddressHeader(field, address, name string) func(*SendOption)
func WithAlternativeBody ¶
func WithAlternativeBody(contentType string, content string, setting gomail.PartSetting) func(*SendOption)
func WithBody ¶
func WithBody(contentType string, content string, setting gomail.PartSetting) func(*SendOption)
func WithCharset ¶
func WithCharset(charset string) func(*SendOption)
func WithCopies ¶
func WithCopies(addresses ...string) func(*SendOption)
func WithHeader ¶
func WithHeader(field string, values ...string) func(*SendOption)
func WithInvisibleCopies ¶
func WithInvisibleCopies(addresses ...string) func(*SendOption)
func WithRecipients ¶
func WithRecipients(addresses ...string) func(*SendOption)
func WithSender ¶
func WithSender(address string, name string) func(*SendOption)
func WithSubject ¶
func WithSubject(subject string) func(*SendOption)
Types ¶
type AddressHeader ¶
type Mailer ¶
type Mailer struct {
// contains filtered or unexported fields
}
func NewMailer ¶
func NewMailer(funcs ...OptionFunc) *Mailer
type OptionFunc ¶
type OptionFunc func(*Option)
func WithCredentials ¶
func WithCredentials(user, password string) OptionFunc
func WithServer ¶
func WithServer(host string, port int) OptionFunc
func WithTLS ¶
func WithTLS(useStartTLS, insecureSkipVerify bool) OptionFunc
type SendFunc ¶
type SendFunc func(*SendOption)
type SendOption ¶
type SendOption struct { Charset string AddressHeaders []AddressHeader Headers []Header Body Body AlternativeBodies []Body }
Click to show internal directories.
Click to hide internal directories.