Versions in this module Expand all Collapse all v0 v0.1.0 Jun 26, 2023 Changes in this version + const Alternative + const Mixed + const Related + const TypeEmail + const TypeHTML + const TypeText + var ErrInvalidEmail = errors.New("email is not valid (missing headers or body)") + type Header map[string][]string + func (h Header) Add(key, value string) + func (h Header) AddressList(key string) ([]*mail.Address, error) + func (h Header) Date() (time.Time, error) + func (h Header) Del(key string) + func (h Header) Encode(exclude ...string) []byte + func (h Header) Get(key string) string + func (h Header) Merge(h2 Header) Header + func (h Header) Set(key, value string) + func (h Header) SetAddressList(key string, value []*mail.Address) + type Mail struct + Bcc []*mail.Address + Body *Part + Cc []*mail.Address + From *mail.Address + MessageId string + ReplyTo []*mail.Address + To []*mail.Address + func New() *Mail + func (m *Mail) AddBcc(address string, name ...string) + func (m *Mail) AddCc(address string, name ...string) + func (m *Mail) AddTo(address string, name ...string) + func (m *Mail) IsValid() bool + func (m *Mail) Send(s Sender) error + func (m *Mail) SetBodyHelper(data []byte, typ string) error + func (m *Mail) SetBodyHtml(txt string) error + func (m *Mail) SetBodyText(txt string) error + func (m *Mail) SetDate(t time.Time) + func (m *Mail) SetFrom(address string, name ...string) + func (m *Mail) SetSubject(subject string) + func (m *Mail) SetTargetHeaders() + func (m *Mail) WriteTo(w io.Writer) (int64, error) + type Part struct + Boundary string + Children []*Part + Data io.Reader + Encoding byte + Headers Header + Type string + func NewPart(typ string) *Part + func (p *Part) Append(c *Part) + func (p *Part) FindType(typ string, recurse bool) *Part + func (p *Part) IsContainer() bool + func (p *Part) IsEmail() bool + func (p *Part) IsEmpty() bool + func (p *Part) IsMultipart() bool + func (p *Part) WriteTo(w io.Writer) (int64, error) + type RelaySender struct + Auth smtp.Auth + Host string + Port int + RequireTLS bool + TLSConfig *tls.Config + func NewDialer(host string, port int, username, password string) *RelaySender + func (r *RelaySender) Send(from string, to []string, msg io.WriterTo) error + type Sender interface + Send func(from string, to []string, msg io.WriterTo) error + var Sendmail Sender = SendmailSender("/usr/sbin/sendmail") + type SendmailSender string + func (s SendmailSender) Send(from string, to []string, msg io.WriterTo) error