node.js - 通过 Node js 使用 Outlook smtp 发送电子邮件

标签 node.js nodemailer starttls

我正在尝试使用 Nodemailer 包发送电子邮件。我收到不同的错误可能是由于 TLS 配置设置错误。我的 Outlook SMTP 使用 STARTTLS 但我不知道如何使用它。我已成功为 Gmail 配置了它,但在使用 Outlook 实现时出现错误。请解释或举个例子。我已经用谷歌搜索了两天但无法找到它。谢谢。

代码片段如下:

const transporter = nodeMailer.createTransport({
    host: 'smtp.office365.com',
    service:'office365',
    port: 587,
    secure: false,  //true for 465 port, false for other ports
    auth: {
      user: 'kuxxxxxxxxxxxxin',
      pass: 'Mxxxxxxxx3'
    },      
    secureConnection: false,
    tls: {
        ciphers: 'SSLv3',
        rejectUnauthorized: true
    }
});

最佳答案

Office 365 不再支持 SSL v3,因为它存在安全漏洞。您必须至少使用 TLS 1.2

关于node.js - 通过 Node js 使用 Outlook smtp 发送电子邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55062273/

相关文章:

ldap - 为什么通过 ssl/tls 的 ldapsearch 不起作用?

c# - 将 StartTLS 与 System.DirectoryServices 中的 LDAP 结合使用

node.js - 使用 google-api-nodejs-client 主体的 Gmail API

Node.js 和 Express : attachment on nodemailer

node.js - 设置 Nodemailer 以使用 STARTLS 握手来保护电子邮件?

node.js - 将 Gmail 与 OAuth 和 Nodemailer 一起使用的 final方法是什么?

email - 端口 587 上的 GMail SMTP STARTTLS 不再有效

javascript - 在 Node.js Express/Connect 中,有没有办法将 session 设置为无限大?

node.js - 如何在我的 MEAN.io 应用程序中使用 ssl

node.js - docker 。 npm 安装 -> 错误 : getaddrinfo ENOTFOUND