I use nodemailer on my dev server @ localhost... And it works fine. I deploy it to my vultr server and its saying authentication unsuccessful

Viewed 22

And yes, the username and password are correct. I copied and pasted them, even the whole code file over to my prod server and still didn't work.

const nodemailer = require('nodemailer');

const transporter = await nodemailer.createTransport({
    service: 'hotmail',
    auth: {
        user: 'myemail@outlook.com',
        pass: 'mypassword'
    }
})

let mail = {
    from: `myemail@outlook.com`,
    to: 'caleb@calebjustice.com',
    subject: 'test subject',
    text: `testing text`
}

transporter.sendMail(mail).then(resp => {
    res.json(resp);
    console.log(resp);
}).catch(er => {
    res.json(er);
    console.log(er);
})
0 Answers
Related