...
|
...
|
@@ -9,7 +9,32 @@ import ( |
|
|
"net"
|
|
|
"net/smtp"
|
|
|
)
|
|
|
/*
|
|
|
用途 发送邮件
|
|
|
1.初始化
|
|
|
InitMailService(&MailConfig{
|
|
|
Host:"smtp.qq.com",
|
|
|
Port:25,
|
|
|
From:"785410885@qq.com",
|
|
|
Password:"ibfduqhfmgypbffe", //授权码
|
|
|
IsUseSsl:false,
|
|
|
})
|
|
|
或者
|
|
|
InitMailService(&MailConfig{
|
|
|
Host:"smtp.qq.com",
|
|
|
Port:465,
|
|
|
From:"785410885@qq.com",
|
|
|
Password:"ibfduqhfmgypbffe", //授权码
|
|
|
IsUseSsl:true,
|
|
|
})
|
|
|
|
|
|
2.发送邮件
|
|
|
SendMail(&MailContent{
|
|
|
ToMail:"892423867@qq.com",
|
|
|
Subject:"测试邮件",
|
|
|
Body:[]byte("邮件内容..."),
|
|
|
})
|
|
|
*/
|
|
|
var(
|
|
|
ErrorInvalidMailConfig = fmt.Errorf("mail config error")
|
|
|
)
|
...
|
...
|
|