Async and sync golang mailer
go get github.com/gronpipmaster/go-mailer
//create mail server
mailServer := mailer.New("example.com:587", "from", "pass")
//listen and wait messages
go mailServer.Listen()
//create message
subject := "Hi"
body := "Hello <a href=\"#\">Some link</a>"
msg := mailer.NewHtmlMessage(
[]string{"[email protected]"},
"[email protected]",
"from username",
subject,
body,
)
//send
mailServer.SendAsync(msg)