Unable to send SMTP mails using office365 settings
I face the similar issue and i resolved it right now,you are most likely facing this issue because your "user" email in the auth option and the "from" email at the mail option are different
make the user and from email same and it will work for you
const transporter = nodemailer.createTransport({ service: 'outlook', port: 587, auth: { user: 'abcde@outlook.com', pass: '******' }, tls: { rejectUnauthorized: false } }); // setup email data with unicode symbols let mailOptions = { from: "abcde@outlook.com", // sender address to: 'xyz@gmail.com', // list of receivers subject: 'Node Contact Request', // Subject line text: 'Hello world?', // plain text body html: output // html body }; // send mail with defined transport object transporter.sendMail(mailOptions, (error, info) => { console.log(info); if (error) { return console.log(error); } console.log('Message sent: %s', info.messageId); console.log('Preview URL: %s', nodemailer.getTestMessageUrl(info)); });
If your email is not verified you will likely to get more errors