I am new to node.js. programming I use the nodemailer module to send emails.
const nodemailer = require ('nodemailer'), credentials=require('./credentials.js'); var mailTransport=nodemailer.createTransport({ service:'Gmail', auth: { user : credentials.gmail.user, pass : credentials.gmail.password, } }); function sendMail(mail_id){ mailTransport.sendMail({ from: ' "my name" < myname@gmail.com >', to : mail_id, // user@gmail.com subject : 'Hello', text: "Hello How do u do ?", },function(err,info){ if(err){ console.log('Unable to send the mail :'+err.message); } else{ console.log('Message response : '+info.response); } }); } exports.sendMail=sendMail;
This is my program for sending letters to other users. But I get an invalid entry . I do not know why this is happening. I am new to node.js scripts and server side.
I use gmail username and password for credentials.
Please help me.
source share