This commit is contained in:
Unknown
2013-05-07 23:43:09 -04:00
parent 9f0b4ae8c1
commit ffca9f3c2b
97 changed files with 7353 additions and 57 deletions

View File

@@ -0,0 +1,29 @@
// smtp_auth.go
package main
import (
"log"
"net/smtp"
)
func main() {
// Set up authentication information.
auth := smtp.PlainAuth(
"",
"user@example.com",
"password",
"mail.example.com",
)
// Connect to the server, authenticate, set the sender and recipient,
// and send the email all in one step.
err := smtp.SendMail(
"mail.example.com:25",
auth,
"sender@example.org",
[]string{"recipient@example.net"},
[]byte("This is the email body."),
)
if err != nil {
log.Fatal(err)
}
}