【发布时间】:2019-06-02 10:10:45
【问题描述】:
我正在使用 Node Express 和 MongoDB 创建一个应用程序。用户创建成功后,想要发送给用户的邮件。我正在使用 zohomail,可以使用这些用户名和密码在线登录 zohomail。但是当我尝试发送邮件时,我收到了一个错误
code: 'EAUTH',
response: '535 Authentication Failed',
responseCode: 535,
command: 'AUTH PLAIN'
这是我的代码
if (user) {
var transporter = nodemailer.createTransport({
host: 'smtp.zoho.com',
port: 465,
secure: true, // use SSL
auth: {
user: 'sample@sample.com', //zoho username
pass: 'password' //zoho password## Heading ##
}
});
var mailOptions = {
from: 'sample@sample.com',
to: req.body.email,
subject: 'Created Successfully',
html: '<h1>Hi ' + req.body.fname + ',</h1><p>You have successfully created.</p>'
};
transporter.sendMail(mailOptions, function(error, info) {
if (error) {
console.log(error);
} else {
res.status(200).send(setting.status("User created Successfully, Please Check your Mail"))
}
});
}
【问题讨论】:
标签: node.js nodemailer zoho