Documentation
¶
Overview ¶
Package mailer sends emails via gmail asynchronously.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mailer ¶
type Mailer struct {
// contains filtered or unexported fields
}
Mailer sends emails asynchronously via gmail.
func New ¶
New creates a new instance. emailId and password are the gmail sender address and password respectively. The created Mailer has a buffer size of 100 and a send wait time of 1s.
func NewWithOptions ¶ added in v0.14.0
NewWithOptions works like New, but allows creation to be configured with options. The defaults for each option are the same as New.
func (*Mailer) Send ¶
Send sends one email asynchronously returning immediately. When it eventually sends the email, it reports any errors to stderr.
func (*Mailer) SendFuture ¶ added in v0.13.0
SendFuture sends one email asynchronously returning immediately. Caller must use returned channel to get the result of the send.
type Option ¶ added in v0.14.0
type Option interface {
// contains filtered or unexported methods
}
Option represents an option for the NewWithOptions method.
func BufferSize ¶ added in v0.14.0
BufferSize sets the maximum number of pending emails before Send or SendFuture block.
func SendWaitTime ¶ added in v0.14.0
SendWaitTime sets the time to wait between email sends.