Documentation ¶
Index ¶
- func UnencryptedAuth(identity, username, password, host string) smtp.Auth
- type Email
- func (m *Email) AddAttachment(filename string) error
- func (m *Email) AddBcc(address string, name string)
- func (m *Email) AddCc(address string, name string)
- func (m *Email) AddTo(address string, name string)
- func (m *Email) GetFrom() string
- func (m *Email) GetHost() string
- func (m *Email) GetMessage() []byte
- func (m *Email) GetTo() []string
- func (m *Email) SetFrom(address string, name string)
- func (m *Email) SetHTML(str string)
- func (m *Email) SetPlain(str []string)
- func (m *Email) SetSubject(subject string, forward bool, reply bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UnencryptedAuth ¶
UnencryptedAuth returns an Auth that implements the PLAIN authentication mechanism as defined in RFC 4616. The returned Auth uses the given username and password to authenticate to host and act as identity. Usually identity should be the empty string, to act as username.
Types ¶
type Email ¶
type Email struct { Addr string // contains filtered or unexported fields }
Email records information about an email.
func NewEmail ¶
NewEmail returns an empty e-mail data. The incoming parameter is a string of "host:port".
func (*Email) AddAttachment ¶
AddAttachment adds an e-mail attachment. The incoming parameter is a string describing the location of the file. The return value contains error information.
func (*Email) GetMessage ¶
GetMessage gets the body content of the mail.
func (*Email) SetHTML ¶
SetHTML sets the e-mail content to html. The incoming parameter is an HTML format string.