nodejs アプリケーションで nodemailer を使用してメールを送信しようとしています。gmail で送信しようとしましたが、すべて問題ありませんでしたが、Mandrill を SMTP プロバイダーとして使用すると、認証エラーが発生しました。
ここに私のコードがあります:
var smtpTransport = nodemailer.createTransport("SMTP",{
service: "Mandrill",
auth: {
user: "username@mydomain.com",
pass: "*****"
}
});
module.exports.sendEmail = function(to, subject, body, callback){
smtpTransport.sendMail({
from: "username@mydomain.com",
to: to,
subject: subject,
html: body
}, function(error, response){
if(error){
console.log(error); callback(error, response);
}else{
callback(null, response);
}
});
};
};
それが私が得たエラーです
{ [AuthError: Invalid login - 435 4.7.8 Error: authentication failed:]
name: 'AuthError',
data: '435 4.7.8 Error: authentication failed:',
stage: 'auth' }