问题描述
我想使用 Nodemailer 通过 3rd 方邮件服务器发送我的网站邮件。 当我从我的电脑发送邮件时一切正常,但我的主机没有。 我在 Cpanel 上设置了邮件服务器 MX 记录。
let transporter = nodemailer.createTransport({
host:'smtp.mailserver.com',port: 587,//25
secure : false,auth: {
user: username,pass: password,},tls: {
rejectUnauthorized: false,debug: true,// show debug output
logger: true // log information in console
});
这是我正确发送邮件的 PC 日志。
这是我的 nodejs 主机日志。
250-nodejsHOSTadress.net 你好 nodejsHOSTadress.net
我也尝试过 465 端口。
let transporter = nodemailer.createTransport({
host:'smtp.mailserver.com',port: 465,secure : true,// show debug output
logger: true // log information in console
});
但是我出现了这个错误。
我更改了邮件服务器提供商,也尝试了 thereal.email,但结果相同。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)