Reputation: 907
I am using nodemailer with nodejs express.
What I want to know is if my mail is sent successfully to the recipient. My mail service belongs to zoho.com.
const nodemailer = require('nodemailer');
let transporter = await nodemailer.createTransport({
host: "smtp.zoho.com",
port: 465,
secure: true,
auth: {
user: '[email protected]',
pass: '******',
},
tls: {
rejectUnauthorized: false
}
});
let info = await transporter.sendMail({
from: '"Test mail" <[email protected]>', // sender address
to: "[email protected]", // list of receivers
subject: "Hello ✔", // Subject line
text: "Hello world?", // plain text body
html: "<b>Hello world?</b>", // html body
}, (error, result) => {
if (error) return console.error(error);
});
The mail "[email protected]" it doesn't exist and the error is not triggered. How to check if my mail is delivered or not, with nodemailer?
Upvotes: 2
Views: 2055
Reputation: 33
Nodemailer can simply pass the message to the relay, and from here Nodemailer gives response of the api. And that's why there will no error occur for invalid e-mail address.
Upvotes: 1