Emailer
A pretty wrapper around go net/smtp
send multiple email using single client
func main() {
var client *emailer.Client
var clientX sync.Mutex
client, err = emailer.NewClient("Sender Name", "[email protected]", "[email protected]", "password", "smtp.gmail.com", "smtp.gmail.com:587", &clientX)
if err != nil {
log.Fatal("Could not initialize client Emailer")
}
var buf bytes.Buffer
tmpl := template.Must(template.ParseFiles("email-template.tmpl.html"))
tmpl.Execute(&buf, nil)
mail := emailer.Mail{
To: []string{"[email protected]"},
Subject: "Test subject",
Body: buf,
}
mail.SendWith(client)
}