nodeclub
nodeclub copied to clipboard
邮件发送失败问题
邮件始终发送不成功,我的配置如下: mail_opts: { host: 'smtp.163.com', secureConnection: true, port: 465, auth: { user: '[email protected]', pass: '客户端授权密码' } }, 配置哪里不对吗?谢谢!
debug = true 的时候不会发送邮件
如果不是这个问题,贴一下错误日志
debug = false 没错,也没有错误提示,错误日志在哪个目录可以找到?
[2017-07-03 09:00:47.911] [ERROR] cheese - send mail finally error { Error: connect ETIMEDOUT 220.181.15.113:25
at Object.exports._errnoException (util.js:1018:11)
at exports._exceptionWithHostPort (util.js:1041:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1086:14)
code: 'ETIMEDOUT',
errno: 'ETIMEDOUT',
syscall: 'connect',
address: '220.181.15.113',
port: 25 } { from: 'Godot中文网 <[email protected]>',
to: '[email protected]',
subject: 'Godot中文网社区帐号激活',
html: '<p>您好:geequlim</p><p>我们收到您在Godot中文网社区的注册信息,请点击下面的链接来激活帐户:</p><a href = "http://47.92.81.123/active_account?key=c7bf5d1517d4893a73253503c3b1cbdd&name=geequlim">激活链接</a><p>若您没有在Godot中文网 社区填写过注册信息,说明有人滥用了您的电子邮箱,请删除此邮件,我们对给您造成的打扰感到抱歉。</p><p>Godot中文网社区 谨上 。</p>',
headers: {} }
我的 qq 邮箱配置:
// 邮箱配置
mail_opts: {
host: 'smtp.qq.com',
port: 465,
secure: true,
auth: {
user: '[email protected]',
pass: '客户端授权密码'
}
}
const mailer = require('nodemailer');
const smtpTransport = require('nodemailer-smtp-transport');
const config = require('../config');
const transporter = mailer.createTransport(smtpTransport(config.mail_opts));
sendMail({
from: from,
to: to,
subject: subject,
html: html
});
是可以正常发送邮件的,
// 邮箱配置 config.mail_opts = { host: 'smtp.exmail.qq.com', port: 465, auth: { user: '[email protected]', pass: 'vdd3333cyy4BFR6', }, ignoreTLS: false, // EnableSsl = true,//经过ssl加密 }; 我这样配置。也没成功不知何故。用的企业邮箱授权码。