| * [net/smtp](http://golang.org/pkg/net/smtp/) |
| * [Email packages](https://github.com/golang/go/wiki/Projects#email) |
| // Connect to the remote SMTP server. |
| c, err := smtp.Dial("mail.example.com:25") |
| // Set the sender and recipient. |
| c.Mail("sender@example.org") |
| c.Rcpt("recipient@example.net") |
| buf := bytes.NewBufferString("This is the email body.") |
| if _, err = buf.WriteTo(wc); err != nil { |
| // Set up authentication information. |
| // Connect to the server, authenticate, set the sender and recipient, |
| // and send the email all in one step. |
| []string{"recipient@example.net"}, |
| []byte("This is the email body."), |