go-mail

📧 A cross platform mail driver for GoLang. Featuring Mailgun, Postal, Postmark, SendGrid, SparkPost & SMTP.

MIT License

Stars
179
go-mail - Headers & http.Client Latest Release

Published by ainsleyclark over 2 years ago

  • Added ability to pass custom headers via transmissions.
  • User can now pass in a custom http.Client to configuration.
go-mail - Postmark Support & Removed Deps

Published by ainsleyclark almost 3 years ago

  • New Postmark driver.
  • Removed all external dependencies from Mailgun, Sparkpost & Sendgrid.
  • Refactored codebase.
  • Moved drivers to seperate package.
go-mail - Fixed Sparkpost From

Published by ainsleyclark over 3 years ago

go-mail - SMTP

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)
}
go-mail - Fixed MailGun

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)
go-mail - Initial Release

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.