【问题标题】:Nodemailer: Error connection timeoutNodemailer:错误连接超时
【发布时间】:2019-05-04 13:05:19
【问题描述】:

我正在尝试使用 nodemailer 发送邮件,它会在 30-40 秒后引发“连接超时”错误。之前相同的代码可以工作,但在更新 nodemailer 和 nodejs 后它停止工作。

nodemailer": "^4.1.0 nodeJs:v8.4.0 npm:5.4.1

请帮忙,在此先感谢。

这是踪迹:

{ Error: Connection timeout
at SMTPConnection._formatError (/root/apps/aprampar/node_modules/nodemailer/lib/smtp-connection/index.js:577:19)
at SMTPConnection._onError (/root/apps/aprampar/node_modules/nodemailer/lib/smtp-connection/index.js:550:20)
at Timeout._connectionTimeout.setTimeout (/root/apps/aprampar/node_modules/nodemailer/lib/smtp-connection/index.js:253:18)
at ontimeout (timers.js:469:11)
at tryOnTimeout (timers.js:304:5)
at Timer.listOnTimeout (timers.js:264:5) code: 'ETIMEDOUT', command: 'CONN' }

【问题讨论】:

  • 有人对此有答案吗?
  • 有人对此有答案吗?

标签: node.js nodemailer


【解决方案1】:

这是网络防火墙的问题。在 95% 的情况下,这是由于网络或 Windows Defender 防火墙的防火墙保护。 尝试先关闭 windows 防御者防火墙,如果仍然存在此问题,请尝试更改网络使用(jio 网络)。因为有时防火墙会阻塞 587 端口,而我们面临这个问题。

【讨论】:

    【解决方案2】:

    事实证明,为了让 Google 授权第三方服务器通过 SMTP 访问您的帐户,您必须在您的 gmail 帐户上启用“安全性较低的应用程序”。

    查看链接:

    https://myaccount.google.com/lesssecureapps?pli=1

    【讨论】:

      猜你喜欢
      • 2017-07-12
      • 1970-01-01
      • 2020-02-10
      • 1970-01-01
      • 2017-09-30
      • 1970-01-01
      • 2016-10-27
      • 1970-01-01
      相关资源
      最近更新 更多