1 min readMay 31, 2019
You must put the access credentials in the auth attribute on the transporter instance.
After that you need to change the email sender in the from attribute in the mailOptions object.
Something like:
let transporter = nodemailer.createTransport({
service: 'gmail',
auth: {
user: 'katira@gmail.com',
pass: 'katira123'
}});...const mailOptions = {
from: 'Akshay Katira <katira@gmail.com>',
to: dest,
...
};...
See the GIST at https://gist.github.com/geeksilva97/0a889a9a29f530fa195397bf20061826#file-index-js
NOTE: This example is for gmail sender, for another configurations see the Nodemailer Docs.