【发布时间】:2018-05-15 16:40:32
【问题描述】:
我使用 nodemailer 在 web 应用程序中使用 keystonejs 作为 cms 发送电子邮件。 Web 应用程序存储在服务器中,电子邮件服务器存储在其他服务器中,但服务器之间的 SMTP 通信不需要密码。现在,我需要在需要时使用没有密码字段的通用帐户向其他人发送电子邮件,因为这不是必需的。 这是我的 nodemailer 配置:
var selfSignedConfig = {
host: 'smtp.abc.cu',
port: 25,
secure: false, // use TLS
auth: {
user: email.email,
pass: email.password //NOT REQUIRED
},
tls: {
// do not fail on invalid certs
rejectUnauthorized: false
}
};
var transporter = nodemailer.createTransport(selfSignedConfig);
// verify connection configuration
和:
"email": {
"email": "abcde@abc.cu",
"password": ""
}
我坚持这一点,我尝试了"password": "" 和"password": " ",但没有任何效果。电子邮件服务器是 Zimbra。
这给了我以下错误:
*-------------------------*
The server IS NOT READY to take the messages: Error: Invalid login: 535 5.7.8 Error: authentication failed: authentication failure
*-------------------------*
您好……
【问题讨论】:
-
根据错误消息,即使
rejectUnauthorized设置为false,也需要密码 -
是的,但问题是电子邮件帐户没有密码,就是这样。
标签: node.js email nodemailer