Documentation ¶
Index ¶
Constants ¶
View Source
const ( MessageTypePlain = "text/plain" MessageTypeHTML = "text/html" )
Message type constants.
Variables ¶
This section is empty.
Functions ¶
func Send ¶ added in v0.2.0
func Send(credentials *Credentials, data *Data) error
Send sends the email.
Types ¶
type Attachment ¶ added in v0.2.0
type Attachment struct { Filename string `json:"filename"` Data string `json:"data"` Inline bool `json:"inline"` }
Attachment represents an email attachment.
type Credentials ¶ added in v0.2.0
type Credentials struct { Address string `json:"address"` Hostname string `json:"hostname"` Name string `json:"name"` Password string `json:"password"` Port string `json:"port"` }
Credentials stores the relevant credenial data to send emails.
type Data ¶ added in v0.2.0
type Data struct { From mail.Address `json:"from"` To []string `json:"to"` CC []string `json:"cc"` BCC []string `json:"bcc"` ReplyTo string `json:"reply_to"` Subject string `json:"subject"` Body string `json:"body"` BodyContentType string `json:"body_content_type"` Headers []*Header `json:"headers"` Attachments []*Attachment `json:"attachments"` }
Data represents a smtp email.
func (*Data) AddAttachmentFromBuffer ¶ added in v0.2.0
AddAttachmentFromBuffer adds an attachment already in a byte array to the Data.
func (*Data) AddAttachmentFromFile ¶ added in v0.2.0
AddAttachmentFromFile adds an attachment from a directory to the Data.
func (*Data) GetRecipients ¶ added in v0.2.0
GetRecipients returns all the recipients from the Data.
func (*Data) ToByteArray ¶ added in v0.2.0
ToByteArray returns all the Data as a byte array.
Click to show internal directories.
Click to hide internal directories.