go 发送邮件

email 模块

func SendMail(i int, err error) {
    e := email.NewEmail()
    e.From = "zj <896829948@qq.com>"
    e.To = []string{"13864264702@163.com"}
    e.Subject = "接口报错信息"
    e.Text = []byte(Product[i] + "报错" + ", 报错信息" + err.Error() )
    e.Cc = []string{"hanjiayu@aibyte.io", "zhangjian@aibyte.io"}
    p := smtp.PlainAuth("", "896829948@qq.com", "jmyfqtusecdjbced", "smtp.qq.com")
    err = e.Send("smtp.qq.com:25", p)
    if err != nil {
        log.Fatal(err)
        fmt.Println(err)
    }
}

 

posted @ 2020-03-20 16:28  眼镜儿  阅读(289)  评论(0编辑  收藏  举报