cronsun smtp 代发邮件 配置

e.g:

{

    "Enable": true,
    "To": ["[email protected]"],
    "#HttpAPI": "如有此字段,则按 http api 方式发送",
    "#Keepalive": "如果此时间段内没有邮件发送,则关闭 SMTP 连接,单位/秒",
    "Keepalive": 60,
    "#doc": "https://godoc.org/github.com/go-gomail/gomail#Dialer",
    "Host": "smtp.163.com",
    "Port": 465,
    "Username": "[email protected]",
    "Password": "此处填授权码",
    "SSL": true,
    "#LocalName": "LocalName is the hostname sent to the SMTP server with the HELO command. By default, 'localhost' is sent.",
    "LocalName": ""

}

{
    "Enable": true,
    "To": ["[email protected]"],
    "#HttpAPI": "如有此字段,则按 http api 方式发送",
    "#Keepalive": "如果此时间段内没有邮件发送,则关闭 SMTP 连接,单位/秒",
    "Keepalive": 60,
    "#doc": "https://godoc.org/github.com/go-gomail/gomail#Dialer",
    "Host": "smtp.qq.com",
    "Port": 465,
    "Username": "[email protected]",
    "Password": "此处填授权码",
    "SSL": true,
    "#LocalName": "LocalName is the hostname sent to the SMTP server with the HELO command. By default, 'localhost' is sent.",
    "LocalName": ""
}



如果有防火墙的话需要开启25端口,不然代发邮件可能不成功。 


猜你喜欢

转载自blog.csdn.net/weixin_41282397/article/details/80682344