News for hackers. Stuff that matters.
Re:Show HN: email - Send emails easily in Go by staunch on Tuesday January 07, 2014 @02:53PM (#7019452)

   package main
   
   import (
       "log"
       "net/smtp"
       "github.com/jordan-wright/email"
   )
   
   func main() {
       e := email.NewEmail()
       e.From = "Jordan Wright <[email protected]>"
       e.To = []string{"[email protected]"}
       e.Bcc = []string{"[email protected]"}
       e.Cc = []string{"[email protected]"}
       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("", "[email protected]", "pw", "smtp.gmail.com"))
       if err != nil {
           log.Fatal(err)
       }
   }

There are no comments on this comment yet.