Error when sending email using nodemailer Error when sending email using nodemailer express express

Error when sending email using nodemailer


You need to set up the transporter differently, using the actual email and password of a real Google Account.

// create reusable transporter object using the default SMTP transportlet transporter = nodemailer.createTransport({    service: 'gmail',    auth: {        user: 'somerealemailaddress@gmail.com', //email address to send from        pass: 'somerealemailpassword' //the actual password for that account    }});


Similar question

Sample code: OAuth2 in Nodemailer

var email_smtp = nodemailer.createTransport({        host: "smtp.gmail.com",  auth: {    type: "OAuth2",    user: "youremail@gmail.com",    clientId: "CLIENT_ID_HERE",    clientSecret: "CLIENT_SECRET_HERE",    refreshToken: "REFRESH_TOKEN_HERE"                                }});


const xoauth2 = require("xoauth2");Actually in my case i didn't make use of the above code which i have mentioned and yet it worked fine...Just changed the google settings from the link sent in the error and it was fine.But i get the error especially when i try to use yahoo as the service provider instead of google.I have attached a screenshot of the error which i get for your reference.The error which i get while using yahoo as service provider