Documentation
¶
Overview ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Attachment ¶
Attachment represents an email attachment
type ContentType ¶
type ContentType int
ContentType represents content type
const ( // TextPlain sets body type to text/plain in message body TextPlain ContentType = iota // TextHTML sets body type to text/html in message body TextHTML )
func (ContentType) String ¶
func (contentType ContentType) String() string
type Dialer ¶
type Dialer struct {
Server string
Port int
TLS bool
Account string
Password string
Timeout time.Duration
}
Dialer is a dialer to an SMTP server.
func (*Dialer) SendMail ¶
SendMail connects to the server at Dialer's addr, switches to TLS if possible, authenticates with the optional mechanism a if possible, and then sends an email from address from, to addresses to, with message msg.
The addresses in the to parameter are the SMTP RCPT addresses.
The msg parameter should be an RFC 822-style email with headers first, a blank line, and then the message body. The lines of msg should be CRLF terminated. The msg headers should usually include fields such as "From", "To", "Subject", and "Cc". Sending "Bcc" messages is accomplished by including an email address in the to parameter but not including it in the msg headers.
type Message ¶
type Message struct {
From *mail.Address
To, Cc, Bcc Receipts
Subject string
Body string
ContentType ContentType
Attachments []*Attachment
}
Message represents an email message