![]() |
git.alexw.nyc | home | about | git | garden |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | package main import ( "log" "net/smtp" ) func SendEmail(email string, subject string, body string) { auth := smtp.PlainAuth("", c.SMTPUsername, c.SMTPPassword, "smtp.migadu.com") msg := "From: " + c.SMTPUsername + "\n" + "To: " + email + "\n" + "Subject:" + subject + "\n" + body err := smtp.SendMail(c.SMTPServer, auth, c.SMTPUsername, []string{email}, []byte(msg)) if err != nil { // doesnt need to block anything i think log.Println(err) } } |