nodemailer : "^2.4.2"
I am sending mail using nodemailer. It's working fine. But while using not existing email, I am not getting any error:
I have code as;
exports.sendMail = function (req, resp, reqBody, callback) {
var smtpTransport = nodemailer.createTransport(settings.smtpConfig);
var data = JSON.parse(reqBody);
var mailOptions={
to : data.toAddress,
cc : data.ccAddress,
bcc : data.bccAddress,
subject : data.subject,
html : data.message
}
smtpTransport.sendMail(mailOptions, function(error, response){
if (error) {
callback(null, error);
}else{
callback(response);
}
});
};
So if i use any not existing email Id it doesn't throw any error;
For eg:If I send toAddress as 'dummy@gmail.com' -- it doesn't throw any error.
I got response as
{ accepted: [ 'dummy@gmail.com' ],
rejected: [],
response: '250 2.0.0 OK 1466501212 23sm18003603qty.40 - gsmtp',
envelope: { from: '', to: [ 'dummy@gmail.com' ] },
messageId: '1466501201867-84b63b27-ce337819-b06c739f@localhost' }
Same case for cc also.
Any help appreciated.