【发布时间】:2016-11-06 14:27:15
【问题描述】:
我正在使用 nodemailer v2.4.2 和 node.js v4.4.7,我想通过我的 Office 365 SMTP 邮件服务器从我的服务器发送电子邮件。我正在使用具有此配置的 smtpTransport v2.5.0:
var transporter = nodemailer.createTransport(smtpTransport({
host: 'smtp.office365.com',
port: 25, // have tried 465
secureConnection: secure,
auth: {
user: username,
pass: password
},
tls: {
rejectUnauthorized: false // don't verify certificates
},
ignoreTLS: false // don't turn off STARTTLS support
}));
我已经尝试指定LOGIN 和PLAIN 中的authMethod,但两者都没有任何区别。当我尝试发送电子邮件时出现错误:
[Error: Invalid login: 504 5.7.4 Unrecognized authentication type]
code: 'EAUTH',
response: '504 5.7.4 Unrecognized authentication type',
responseCode: 504
是否有人知道 Office 365 需要什么授权类型以及我是否需要在 nodemailer 设置中指定任何不同的设置?
【问题讨论】:
-
plz,如果解决了你的问题,请标记正确答案!
标签: office365 nodemailer