Documentation ¶
Index ¶
- type CopyFunc
- type Dialer
- type Message
- func (m *Message) AddBcc(address ...string)
- func (m *Message) AddCc(address ...string)
- func (m *Message) AddCopierBody(contentType string, copier CopyFunc)
- func (m *Message) AddHeader(key string, value ...string)
- func (m *Message) AddHtmlBody(html string)
- func (m *Message) AddPlainBody(text string)
- func (m *Message) AddRcptBcc(bcc ...*mail.Address)
- func (m *Message) AddRcptCc(cc ...*mail.Address)
- func (m *Message) AddRcptTo(to ...*mail.Address)
- func (m *Message) AddTo(address ...string)
- func (m *Message) Attach(filename string, copier CopyFunc)
- func (m *Message) Embed(cid string, copier CopyFunc)
- func (m *Message) SetBcc(address ...string)
- func (m *Message) SetCc(address ...string)
- func (m *Message) SetCopierBody(contentType string, copier CopyFunc)
- func (m *Message) SetDate(datefmt string)
- func (m *Message) SetFrom(from string)
- func (m *Message) SetHtmlBody(html string)
- func (m *Message) SetPlainBody(text string)
- func (m *Message) SetRcptBcc(bcc ...*mail.Address)
- func (m *Message) SetRcptCc(cc ...*mail.Address)
- func (m *Message) SetRcptTo(to ...*mail.Address)
- func (m *Message) SetSubject(subject string)
- func (m *Message) SetTo(address ...string)
- func (m *Message) SetUserAgent(ua string)
- func (m *Message) WriteTo(w io.Writer) (int64, error)
- type Sender
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CopyFunc ¶
CopyFunc is the function that runs when the message is sent. It should copy the content of the emails to the io.Writer(SMTP).
type Dialer ¶
type Dialer struct { // Host represents the host of the SMTP server. Host string // Port represents the port of the SMTP server. Port int // Username is the username to use to authenticate to the SMTP server. Username string // Password is the password to use to authenticate to the SMTP server. Password string // SSLOnConnect defines whether an SSL connection is used. // It should be false while SMTP server use the STARTTLS extension. SSLOnConnect bool // TSLConfig represents the TLS configuration. // It is used for the TLS (when the // STARTTLS extension is used) or SSL connection. TLSConfig *tls.Config // Timeout is passed to net.Dialer's Timeout. Timeout time.Duration }
Dialer is a dialer to an SMTP server.
func (*Dialer) Dial ¶
Dial dials and authenticates to an SMTP server. The returned *Sender should be closed when done using it.
func (*Dialer) DialAndSend ¶
DialAndSend opens a connection to the SMTP server, sends the given emails and closes the connection.
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
Message represents an email message.
func (*Message) AddCopierBody ¶
AddCopierBody adds a custom part of the body of email message.
func (*Message) AddHtmlBody ¶
AddHtmlBody adds a html part of the body of email message.
func (*Message) AddPlainBody ¶
AddPlainBody adds a text part of the body of email message.
func (*Message) AddRcptBcc ¶
AddRcptBcc adds the header of email message: 'BCC'.
func (*Message) SetCopierBody ¶
SetCopierBody sets a custom part of the body of email message.
func (*Message) SetHtmlBody ¶
SetHtmlBody sets a html part of the body of email message.
func (*Message) SetPlainBody ¶
SetPlainBody sets a text part of the body of email message.
func (*Message) SetRcptBcc ¶
SetRcptBcc sets the header of email message: 'BCC'.
func (*Message) SetSubject ¶
SetSubject sets the header of email message: 'SUBJECT'.
func (*Message) SetUserAgent ¶
SetUserAgent sets the header of email message: 'USER-AGENT'.