Documentation ¶
Index ¶
- Constants
- func GenerateAddress(context *EmailAddress) (string, error)
- func GenerateAttachment(attachment *EmailAttachment) (string, error)
- func GenerateBody(message, contentType, boundary string) (string, error)
- func GenerateBoundary() string
- func GenerateHeaders(sender, recipient, subject, boundary string) (string, error)
- func Send(subject, message, messageType string, sender, recipient *EmailAddress, ...) error
- func SendFromServer(subject, message, messageType, server string, sender, recipient *EmailAddress, ...) error
- type EmailAddress
- type EmailAttachment
- type EmailBody
- type EmailHeaders
Constants ¶
View Source
const ( MAIL_SERVER = "localhost" MAIL_PORT = 25 LINE_MAX_LEN = 500 // for splitting encoded attachment data // templates for generating the message components ADDRESS = "\"{{.DisplayName}}\" <{{.Address}}>" HEADERS = "" /* 156-byte string literal not displayed */ BODY = "\r\n--{{.Boundary}}\r\nContent-Type: {{.ContentType}}\r\n\r\n{{.MessageBody}}" ATTACHMENT = "" /* 208-byte string literal not displayed */ // message body mime types TEXT_MIME = "text/plain" HTML_MIME = "text/html" )
Variables ¶
This section is empty.
Functions ¶
func GenerateAddress ¶
func GenerateAddress(context *EmailAddress) (string, error)
func GenerateAttachment ¶
func GenerateAttachment(attachment *EmailAttachment) (string, error)
func GenerateBody ¶
func GenerateBoundary ¶
func GenerateBoundary() string
GenerateBoundary produces a random string that can be used for the email multipart boundary marker
func GenerateHeaders ¶
func Send ¶
func Send(subject, message, messageType string, sender, recipient *EmailAddress, attachments []*EmailAttachment) error
Send transmits the given message, with optional attachments, via the default mail server (localhost) and port (25)
func SendFromServer ¶
func SendFromServer(subject, message, messageType, server string, sender, recipient *EmailAddress, attachments []*EmailAttachment, port int) error
SendFromServer transmits the given message, with optional attachments, via the defined mail server and port
Types ¶
type EmailAddress ¶
type EmailAttachment ¶
Click to show internal directories.
Click to hide internal directories.