Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mail ¶
type Mail struct { Domain string Templates string Host string Port int Username string Password string Encryption string FromAddress string FromName string Jobs chan Message Results chan Result API string APIKey string APIUrl string }
Mail holds the information necessary to connect to an SMTP server
func (*Mail) ListenForMail ¶
func (m *Mail) ListenForMail()
ListenForMail listens to the mail channel and sends mail when it receives a payload. It runs continually in the background, and sends error/success messages back on the Results channel. Note that if api and api key are set, it will prefer using an api to send mail
func (*Mail) Send ¶
Send sends an email message using correct method. If API values are set, it will send using the appropriate api; otherwise, it sends via smtp
func (*Mail) SendSMTPMessage ¶
SendSMTPMessage builds and sends an email message using SMTP. This is called by ListenForMail, and can also be called directly when necessary
func (*Mail) SendUsingAPI ¶
SendUsingAPI sends a message using the appropriate API. It can be called directly, if necessary.