Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.