I create a project and follow all the steps written in response to Nodemailer / Gmail. What is an update token and how can I get it? But I am wrong.
I am using the following code:
var smtpTransport = nodemailer.createTransport("SMTP", { service: "Gmail", connectionTimeout : "7000", greetingTimeout : "7000", auth: { XOAuth2: { user: "", clientId: "", clientSecret: "", refreshToken: "" } } }); var mailOptions = { from: "", to:usersEmailId, subject: 'subject', html: 'string Of Html' } smtpTransport.sendMail(mailOptions, function(error, response){ if(error){ console.log(error); }else{ console.log("Message sent: " + response.message); } smtpTransport.close(); });
Getting the following error
{ [Error: Connection timeout] code: 'ETIMEDOUT', errno: 'ETIMEDOUT', stage: 'init' } { [Error: Connection timeout] code: 'ETIMEDOUT', errno: 'ETIMEDOUT', stage: 'init' } { [XOAUTH2Error: invalid_client] name: 'XOAUTH2Error', stage: 'auth' } { [XOAUTH2Error: invalid_client] name: 'XOAUTH2Error', stage: 'auth' }
and my second question is how to send an attachment. I have only the file name and file url .
user5440676 Mar 04 '16 at 11:14 2016-03-04 11:14
source share