Created
November 12, 2014 06:20
-
-
Save mikespook/8ec5735344dc561e7428 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"github.com/mikespook/golib/log" | |
"gopkg.in/gomail.v1" | |
) | |
func main() { | |
addr := "mail.awecent.com" | |
port := 25 | |
user := "noreply@awecent.com" | |
password := "noreply12#$" | |
msg := gomail.NewMessage() | |
msg.SetHeader("From", user) | |
msg.SetHeader("To", "xingx@millionhero.com") | |
msg.SetHeader("Subject", "Hello world") | |
msg.SetBody("text/html", "Hello world") | |
mailer := gomail.NewMailer(addr, user, password, port) | |
if err := mailer.Send(msg); err != nil { | |
log.Error(err) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment