Nodemailer - 发送邮件时出错:连接 ETIMEDOUT 204.79.197.212:587

Nodemailer - Error while sending mail: connect ETIMEDOUT 204.79.197.212:587

我已经禁用了我的防火墙,但我仍然遇到同样的错误,有人有解决方案吗

[2022-01-31 16:37:35] 调试创建传输:nodemailer (6.7.2; +https://nodemailer.com/; SMTP/6.7.2[client:6.7 .2])

[2022-01-31 16:37:35] DEBUG 使用 SMTP/6.7.2[client:6.7.2]

发送邮件

[2022-01-31 16:37:35] DEBUG [yeVtB39osUE] 已解决 smtp.live.com 为 204.79.197.212 [缓存未命中]

[2022-01-31 16:37:49] 错误 [yeVtB39osUE] 连接 ETIMEDOUT 204.79.197.212:587

[2022-01-31 16:37:49] DEBUG [yeVtB39osUE] 使用“destroy”关闭与服务器的连接

[2022-01-31 16:37:49] 错误发送错误:连接 ETIMEDOUT 204.79.197.212:587

发送邮件时出错:错误:连接 ETIMEDOUT 204.79.197.212:587

转到

设置 => 查看所有 Outlook 设置 => 邮件 => 同步电子邮件

这是您正确设置的信息

test image

编辑(2022 年 4 月):此问题已在 nodemailer v6.7.3 中修复!

我有完全相同的错误!

我不知道为什么,但是使用 smtp-mail.outlook.com 代替 smpt.live.com(当您使用 outlook/hotmail 预定义服务时 nodemailer 默认使用)效果很好并且修复此错误!

const transporter = nodemailer.createTransport({
    host: 'smtp-mail.outlook.com',
    port: 587,
    auth: {
        user: 'your-email-address',
        pass: 'your-password'
    }
})