Documentation
¶
Overview ¶
Wrapper to MailerSend Go Library https://github.com/MailerSend/MailerSend-apiv3-go
Wrapper to MailJet Go Library https://github.com/mailjet/mailjet-apiv3-go
There is no golang API provided for mailtrap ¶
Wrapper to SendGrid's Go Library https://github.com/sendgrid/sendgrid-go
Wrapper to Smtp2go Go Library https://github.com/Smtp2go/Smtp2go-apiv3-go
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrMissingFrom = errors.New("sendmail: missing 'from' email address")
var ErrMissingRecipients = errors.New("sendmail: missing recipient(s) address")
var ErrMissingSubject = errors.New("sendmail: missing subject")
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
type MailJetConfig ¶
SendMailConfig holds the API key for MailJet
type MailJetMailManager ¶
type MailJetMailManager struct {
APIKey string
SecretKey string
// User defined logger function.
Logger func(string, ...interface{})
// contains filtered or unexported fields
}
SendMailManager provides functionality to send emails via MailJet
func NewMailJet ¶
func NewMailJet(apiKey string, secretKey string) (*MailJetMailManager, error)
func (*MailJetMailManager) SendMail ¶
func (mj *MailJetMailManager) SendMail(fromName, fromEmail, toName, toEmail, subject, plainTextContent, htmlContent string) (response *Response, err error)
func (*MailJetMailManager) SendMessage ¶
func (mj *MailJetMailManager) SendMessage(message *Message) (response *Response, err error)
type MailTrap ¶
type MailTrap struct {
// contains filtered or unexported fields
}
MailTrapConfig provides functionality to send emails via mailtrap https://mailtrap.io/blog/golang-send-email/#Send-emails-in-Go-using-email-API
func NewMailTrap ¶
type MailerSend ¶
type MailerSend struct {
// override logging using user defined logger function.
Logger func(string, ...interface{})
// contains filtered or unexported fields
}
func NewMailerSend ¶
func NewMailerSend(apiToken string) (*MailerSend, error)
func (*MailerSend) SendMail ¶
func (ms *MailerSend) SendMail(fromName, fromEmail, toName, toEmail, subject, plainTextContent, htmlContent string) (response *Response, err error)
func (*MailerSend) SendMessage ¶
func (ms *MailerSend) SendMessage(message *Message) (response *Response, err error)
type Message ¶
type MessageBuilder ¶
type MessageBuilder interface {
FromEmail(name, address string) MessageBuilder
AddRecipient(name, address string) MessageBuilder
Subject(subject string) MessageBuilder
PlainTextContent(plainTextContent string) MessageBuilder
HtmlContent(htmlContent string) MessageBuilder
AddAttachment(contentType, filename, base64Content string, disposition_optional ...string) MessageBuilder
Build() (*Message, error)
}
func NewEmailMessage ¶
func NewEmailMessage() MessageBuilder
type Response ¶
type Response struct {
StatusCode int // e.g. 200
Body string // e.g. {"result: success"}
Headers map[string][]string // e.g. map[X-Ratelimit-Limit:[600]]
}
Response holds the response from an API call.
type SendMail ¶
type SendMail interface {
// send mail is intended for a single recipient
SendMail(fromName, fromEmail, toName, toEmail, subject, plainTextContent, htmlContent string) (response *Response, err error)
// SendMessage allows for more complex email scenarios, including sending emails to multiple recipients and attachments
SendMessage(message *Message) (response *Response, err error)
}
type Smtp2goMail ¶
type Smtp2goMail struct {
APIToken string
// User defined logger function.
Logger func(string, ...interface{})
}
SendMailManager provides functionality to send emails via Smtp2go
func NewSmtp2go ¶
func NewSmtp2go(smtp2goKey string) (*Smtp2goMail, error)
func (*Smtp2goMail) SendMail ¶
func (ms *Smtp2goMail) SendMail(fromName, fromEmail, toName, toEmail, subject, plainTextContent, htmlContent string) (response *Response, err error)
func (*Smtp2goMail) SendMessage ¶
func (ms *Smtp2goMail) SendMessage(message *Message) (response *Response, err error)
type TrilloSendMail ¶
type TrilloSendMail struct {
APIKey string
// User defined logger function.
Logger func(string, ...interface{})
// contains filtered or unexported fields
}
SendMailManager provides functionality to send emails via SendGrid
func NewSendGrid ¶
func NewSendGrid(apiKey string) (*TrilloSendMail, error)
NewSendGrid creates a new instance of TrilloSendMail
func (*TrilloSendMail) SendMail ¶
func (t *TrilloSendMail) SendMail(fromName, fromEmail, toName, toEmail, subject, plainTextContent, htmlContent string) (response *Response, err error)
func (*TrilloSendMail) SendMessage ¶
func (t *TrilloSendMail) SendMessage(message *Message) (response *Response, err error)
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
basic
command
|
|
|
mailtrap-demo
command
|
|
|
messagebuilder
command
|
|
|
overridelog
command
|
|
|
smtp2go
command
|
|
|
try-multi-services
command
|