在node.js后端中使用gmail-send时出现连接超时错误

我尝试使用node.js后端中的gmail-send包发送电子邮件。

var send = require('gmail-send')({
    user: '*@gmail.com',pass: '*',subject: '*',to: '*@gmail.com'
})
send({
    html: stringTemplate
},function(err,res,full){
    if (err) {
        console.log(err);
    }
})

这是我的代码,但出现此错误。

{ Error: Connection timeout
    at SMTPConnection._formatError (E:\project\node_modules\nodemailer\lib\smtp-connection\index.js:771:19)
    at SMTPConnection._onError (E:\project\node_modules\nodemailer\lib\smtp-connection\index.js:757:20)
    at Timeout._connectionTimeout.setTimeout (E:\project\node_modules\nodemailer\lib\smtp-connection\index.js:229:22)
    at ontimeout (timers.js:436:11)
    at tryOnTimeout (timers.js:300:5)
    at listOnTimeout (timers.js:263:5)
    at Timer.processTimers (timers.js:223:10) code: 'ETIMEDOUT',command: 'CONN' }

很长一段时间以来,我一直在努力解决这个问题,但找不到解决方案。 在使用nodemailer之前,但我也遇到相同的错误。 请帮我。谢谢您的仔细观察。

lixuanpei 回答:在node.js后端中使用gmail-send时出现连接超时错误

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3098067.html

大家都在问