You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
476 B
22 lines
476 B
2 months ago
|
package main
|
||
|
|
||
|
import (
|
||
|
"log"
|
||
|
"net/smtp"
|
||
|
|
||
|
"github.com/jordan-wright/email"
|
||
|
)
|
||
|
|
||
|
func main() {
|
||
|
e := email.NewEmail()
|
||
|
e.From = "lin <13950405063@163.com>"
|
||
|
e.To = []string{"349589071@qq.com"}
|
||
|
e.Cc = []string{"linquan13950405063@163.com"}
|
||
|
e.Subject = "Awesome web"
|
||
|
e.Text = []byte("Text Body is, of course, supported!")
|
||
|
err := e.Send("smtp.163.com:25", smtp.PlainAuth("", "linquan13950405063@163.com", "lin_quan120", "smtp.163.com"))
|
||
|
if err != nil {
|
||
|
log.Fatal(err)
|
||
|
}
|
||
|
}
|