通过Node JS使用Outlook SMTP发送电子邮件

时间:2019-03-08 11:26:04

标签: node.js nodemailer starttls

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

代码段如下:

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
    }
});

1 个答案:

答案 0 :(得分:0)

Office 365由于存在安全漏洞而不再支持SSL v3。您必须至少使用TLS 1.2

相关问题