📧 A cross platform mail driver for GoLang. Featuring Mailgun, Postal, Postmark, SendGrid, SparkPost & SMTP.
MIT License
http.Client
to configuration.Published by ainsleyclark almost 3 years ago
Published by ainsleyclark over 3 years ago
Published by ainsleyclark over 3 years ago
New SMTP Driver (non TLS).
func SMTP() {
cfg := mail.Config{
URL: "smtp.gmail.com",
FromAddress: "[email protected]",
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{"[email protected]"},
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)
}
Published by ainsleyclark over 3 years ago
Fixed MailGun not rendering HTML
mailgun.go
message := m.client.NewMessage(m.cfg.FromAddress, t.Subject, t.PlainText, t.Recipients...)
message.SetHtml(t.HTML)
Published by ainsleyclark over 3 years ago
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.