3 ms·
package main import ( "log" "net/smtp" "github.com/jordan-wright/email" ) func main() { e := email.NewEmail()
by staunch 13y ago
package main
import (
"log"
"net/smtp"
"github.com/jordan-wright/email"
)
func main() {
e := email.NewEmail()
e.From = "Jordan Wright <test@gmail.com>"
e.To = []string{"test@example.com"}
e.Bcc = []string{"test_bcc@example.com"}
e.Cc = []string{"test_cc@example.com"}
e.Subject = "Awesome Subject"
e.Text = "Text Body is, of course, supported!"
e.HTML = "<h1>Fancy HTML is supported, too!</h1>"
err := e.Send("smtp.gmail.com:587",
smtp.PlainAuth("", "x@gmail.com", "pw", "smtp.gmail.com"))
if err != nil {
log.Fatal(err)
}
}