Releases: ainsleyclark/go-mail
Releases · ainsleyclark/go-mail
Headers & http.Client
- Added ability to pass custom headers via transmissions.
- User can now pass in a custom
http.Client
to configuration.
Postmark Support & Removed Deps
- New Postmark driver.
- Removed all external dependencies from Mailgun, Sparkpost & Sendgrid.
- Refactored codebase.
- Moved drivers to seperate package.
Fixed Sparkpost From
v1.0.3 Fixed sparkpost from sending
SMTP
New SMTP Driver (non TLS).
func SMTP() {
cfg := mail.Config{
URL: "smtp.gmail.com",
FromAddress: "hello@gophers.com",
FromName: "Gopher",
Password: "my-password",
Port: 587,
}
driver, err := mail.NewClient(mail.SMTP, cfg)
if err != nil {
fmt.Println(err)
return
}
tx := &mail.Transmission{
Recipients: []string{"hello@gophers.com"},
Subject: "My email",
HTML: "<h1>Hello from go mail!</h1>",
PlainText: "plain text",
}
result, err := driver.Send(tx)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(result)
}
Fixed MailGun
Fixed MailGun not rendering HTML
mailgun.go
message := m.client.NewMessage(m.cfg.FromAddress, t.Subject, t.PlainText, t.Recipients...)
message.SetHtml(t.HTML)
Initial Release
This is the first release of the application which supports the following frameworks:
SparkPost,
MailGun,
SendGrid
Users should reference the README.md for more information, it is kept up to date with releases.