Versions in this module Expand all Collapse all v1 v1.0.0 Nov 24, 2026 Changes in this version + type Attachment struct + ContentType string + Data []byte + Name string + type Auth = smtp.Auth + func LoginAuth(username, password string) Auth + func PlainAuth(identity, username, password, host string) Auth + func XOAuth2Auth(username, token string) Auth + type Config struct + Auth Auth + Host string + MaxConcurrency int + MaxIdle int + MaxOpen int + NoopTimeout time.Duration + OnDial func(duration time.Duration, err error) + OnSend func(duration time.Duration, err error) + Port int + TLSConfig *tls.Config + TLSMode TLSMode + Timeout time.Duration + type Mailer struct + func New(cfg Config) (*Mailer, error) + func (m *Mailer) Close() + func (m *Mailer) Send(ctx context.Context, msg *Message) error + func (m *Mailer) SendBulk(ctx context.Context, msg *Message, recipients []string) error + type Message struct + Attachments []Attachment + Bcc []string + Cc []string + Date time.Time + From string + HTML string + Headers map[string]string + MessageID string + Subject string + Text string + To []string + func (m *Message) Bytes() ([]byte, error) + type TLSMode int + const TLSImplicit + const TLSNone + const TLSStart