【发布时间】:2019-05-08 03:21:39
【问题描述】:
我正在使用 nodemailer 发送电子邮件,但我的防病毒软件阻止了 nodemailer。当我关闭防病毒软件后,发送电子邮件就没有问题了。
有没有可能在不禁用杀毒软件的情况下使用 nodemailer 发送电子邮件的方法?
const transporter = nodemailer.createTransport({
host: 'smtp.gmail.com',
port: 465,
secure: true,
auth: {
user: 'username@gmail.com',
pass: 'password'
}
});
var mailOptions = {
from: 'username@gmail.com',
to: "to',
subject: 'subject',
html: '<div></div>'
};
transporter.sendMail(mailOptions, function (error, info) {
if (error) {
console.log(error)
} else {
console.log('Email sent: ' + info.response);
}
});
错误信息 ->
{ Error: self signed certificate in certificate chain
at TLSSocket.<anonymous> (_tls_wrap.js:1105:38)
at emitNone (events.js:106:13)
at TLSSocket.emit (events.js:208:7)
at TLSSocket._finishInit (_tls_wrap.js:639:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:469:38) code: 'ESOCKET',
command: 'CONN' }
【问题讨论】:
标签: gmail nodemailer antivirus