Documentation ¶
Index ¶
- type Attachment
- type EmailHelper
- func (instance *EmailHelper) NewHTMLMessage(subject string, body string) *Message
- func (instance *EmailHelper) NewMessage(subject string, body string) *Message
- func (instance *EmailHelper) NewSender(settings ...interface{}) (*SmtpSender, error)
- func (instance *EmailHelper) Send(addr string, auth smtp.Auth, m *Message) error
- func (instance *EmailHelper) SendMessage(host string, port int, secure bool, user string, pass string, ...) (err error)
- func (instance *EmailHelper) SendSecure(addr string, auth smtp.Auth, tlsConfig *tls.Config, m *Message) error
- type Header
- type Message
- func (m *Message) AddAttachment(file string) error
- func (m *Message) AddAttachmentBinary(filename string, buf []byte, inline bool) error
- func (m *Message) AddAttachmentInline(file string) error
- func (m *Message) AddBcc(address mail.Address) []string
- func (m *Message) AddCc(address mail.Address) []string
- func (m *Message) AddHeader(key string, value string) Header
- func (m *Message) AddTo(address mail.Address) []string
- func (m *Message) GetBytes() []byte
- func (m *Message) GetToList() []string
- type SmtpSender
- func (instance *SmtpSender) Configure(settings interface{}) (err error)
- func (instance *SmtpSender) Send(subject, body string, to, bcc, cc []string, from, replyTo string, ...) error
- func (instance *SmtpSender) SendAsync(subject, body string, to, bcc, cc []string, from, replyTo string, ...)
- func (instance *SmtpSender) SendMessage(message *Message) (err error)
- func (instance *SmtpSender) SendMessageAsync(message *Message, callback func(error))
- type SmtpSettings
- type SmtpSettingsAuth
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
Attachment represents an email attachment.
type EmailHelper ¶
type EmailHelper struct { }
var Email *EmailHelper
func (*EmailHelper) NewHTMLMessage ¶
func (instance *EmailHelper) NewHTMLMessage(subject string, body string) *Message
NewHTMLMessage returns a new Message that can compose an HTML email with attachments
func (*EmailHelper) NewMessage ¶
func (instance *EmailHelper) NewMessage(subject string, body string) *Message
NewMessage returns a new Message that can compose an email with attachments
func (*EmailHelper) NewSender ¶
func (instance *EmailHelper) NewSender(settings ...interface{}) (*SmtpSender, error)
NewSender returns a new Message Sender
func (*EmailHelper) SendMessage ¶
func (*EmailHelper) SendSecure ¶
func (instance *EmailHelper) SendSecure(addr string, auth smtp.Auth, tlsConfig *tls.Config, m *Message) error
SendSecure sends the message over TLS.
type Message ¶
type Message struct { From *mail.Address To []string Cc []string Bcc []string ReplyTo string Subject string Body string BodyContentType string Headers []Header Attachments map[string]*Attachment }
Message represents a smtp message.
func (*Message) AddAttachment ¶
AddAttachment attaches a file.
func (*Message) AddAttachmentBinary ¶
AddAttachmentBinary attaches a binary attachment.
func (*Message) AddAttachmentInline ¶
AddAttachmentInline includes a file as an inline attachment.
type SmtpSender ¶
type SmtpSender struct {
// contains filtered or unexported fields
}
func (*SmtpSender) Configure ¶
func (instance *SmtpSender) Configure(settings interface{}) (err error)
func (*SmtpSender) SendMessage ¶
func (instance *SmtpSender) SendMessage(message *Message) (err error)
func (*SmtpSender) SendMessageAsync ¶
func (instance *SmtpSender) SendMessageAsync(message *Message, callback func(error))
type SmtpSettings ¶
type SmtpSettingsAuth ¶
Click to show internal directories.
Click to hide internal directories.