Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoginAuth ¶
LoginAuth returns an Auth that implements the LOGIN authentication mechanism. The returned Auth uses the given username and password to authenticate to host.
LoginAuth will only send the credentials if the connection is using TLS or is connected to localhost. Otherwise authentication will fail with an error, without sending the credentials.
func SendEmailsTLS ¶
SendEmailsTLS sends a list of email messages, defined as instances of github.com/jordan-wright/email.Email, over SMTP.
It returns the slice index of the email message that failed to be sent as well as the reason for the failure.
Arguments: ¶
sender: An instance of mailer.Sender
emails: A slice of github.com/jordan-wright/email.Email instances
host: The senders SMTP host address
auth: An instance of mailer.Auth (authentication mechanism such as PLAIN, LOGIN, etc,.)
Types ¶
type Auth ¶
type Auth uint8
Auth is an intermediary representation of a type of supported Auth authentication mechanism
type CSVData ¶
type CSVData interface{}
CSVData is an empty interface for types which support marshalling to/unmarshalling from raw CSV data.
type List ¶
type List struct {
// contains filtered or unexported fields
}
List is a convenience type that unmarshals a CSV string and converts it into a of slice of strings, and vice versa.
func (*List) MarshalCSV ¶
MarshalCSV is a helper method which marshals the data from a List struct into a CSV string.
func (*List) UnmarshalCSV ¶
UnmarshalCSV is a helper method which unmarshals a CSV string into a List struct with []string.
type Receiver ¶
type Receiver struct { Email string `csv:"email"` Cc *List `csv:"cc"` Bcc *List `csv:"bcc"` Variables *Variables `csv:"variables"` }
Receiver represents the recipient of an email message.
type Sender ¶
type Sender struct { Email string `csv:"email"` Password string `csv:"password"` Name string `csv:"name"` }
Sender represents an email sender with the necessary information for authentication.
type Variables ¶
type Variables struct {
// contains filtered or unexported fields
}
Variables is a convenience type that unmarshals a CSV string with the format "KEY=VALUE" and converts it into a of map of string keys and values, and vice versa.
func (*Variables) MarshalCSV ¶
MarshalCSV is a helper method which marshals the data from a Variables struct into a CSV string.
func (*Variables) UnmarshalCSV ¶
UnmarshalCSV is a helper method which unmarshals a CSV string into a Variables struct with map[string]string data.