Documentation
¶
Index ¶
- Constants
- type Email
- type EmailAttachment
- type EmailCredentials
- type EmailData
- func (ed *EmailData) AddAttachment(file string, inline bool) error
- func (ed *EmailData) AddHeader(key string, value string) Header
- func (ed *EmailData) AttachBuffer(filename string, buf []byte, inline bool) error
- func (ed *EmailData) GetRecipients() []string
- func (ed *EmailData) ToByteArray() []byte
- type Header
Constants ¶
View Source
const ( MessageTypePlain = "text/plain" MessageTypeHTML = "text/html" )
Message type constants.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Email ¶
type Email struct {
Credentials *EmailCredentials `json:"credentials"`
Data *EmailData `json:"data"`
}
Email represents an email.
type EmailAttachment ¶
type EmailAttachment struct {
Filename string `json:"filename"`
Data []byte `json:"data"`
Inline bool `json:"inline"`
}
EmailAttachment represents an email attachment.
type EmailCredentials ¶
type EmailCredentials struct {
Address string `json:"address"`
Hostname string `json:"hostname"`
Name string `json:"name"`
Port string `json:"port"`
Password string `json:"password"`
}
EmailCredentials stores the relevant credenial data to send emails.
type EmailData ¶
type EmailData struct {
From mail.Address `json:"from"`
To []string `json:"to"`
CC []string `json:"cc"`
BCC []string `json:"bcc"`
ReplyTo string `json:"replyto"`
Subject string `json:"subject"`
Body string `json:"body"`
BodyContentType string `json:"bodycontenttype"`
Headers []Header `json:"headers"`
Attachments map[string]*EmailAttachment `json:"attachments"`
}
EmailData represents a smtp message.
func (*EmailData) AddAttachment ¶
AddAttachment adds a new attachment to the EmailData.
func (*EmailData) AttachBuffer ¶
AttachBuffer attaches a binary attachment to the EmailData.
func (*EmailData) GetRecipients ¶
GetRecipients returns all the recipients from the EmailData.
func (*EmailData) ToByteArray ¶
ToByteArray returns all the EmailData as a byte array.
Click to show internal directories.
Click to hide internal directories.