Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
196
rated 0 times [  197] [ 1]  / answers: 1 / hits: 39655  / 10 Years ago, sat, november 15, 2014, 12:00:00

I am new to node.js programming .I am using nodemailer module for sending 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 <[email protected]>',
to : mail_id, //[email protected]
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 emails to different users. But I am getting Invalid Login . I don't have any idea why this is coming . I am new to node.js and server side scripting.

I am using my gmail username and password for credentials.

Please help me.


More From » node.js

 Answers
27

Did you double-check your login credentials? Also did you double-check your from adress to match your email?



I used the nodemailer for some tests 3 weeks ago with the gmail example given on the github page and it worked like a charm:



https://github.com/andris9/Nodemailer



Invalid login indicates mistyped/wrong credentials.


[#68794] Thursday, November 13, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
maryann

Total Points: 600
Total Questions: 104
Total Answers: 97

Location: Sint Maarten
Member since Tue, Mar 29, 2022
2 Years ago
maryann questions
Fri, Oct 15, 21, 00:00, 3 Years ago
Thu, Aug 13, 20, 00:00, 4 Years ago
Wed, Jul 17, 19, 00:00, 5 Years ago
Mon, Dec 17, 18, 00:00, 6 Years ago
;