0

I cannot able to send the mail using nodejs program I used node-mailer and nodemailer smtp transport module.This program worked perfectly lastweek.but suddenly now it is not working .I tried but i cannot able to find the error.can anyone help me .Thankyou.

var nodemailer = require('nodemailer');
var smtpTransport = require('nodemailer-smtp-transport');
var transporter = nodemailer.createTransport(smtpTransport({
    service: 'Gmail',
    host: 'smtp.gmail.com',
    port: 465,
    auth: {
        user: 'sampleprogrammers@gmail.com',
        pass: 'ashbdhbedbudu.'
    }
}));

transporter.sendMail({
    from: "sampleprogrammers@gmail.com",
    subject:" hello ji " ,
    text: "I would like to write dialogue",
    attachments:[
        {
            'filename':'link.txt',
            'path': 'E:/STUDIES/CORE SUBJECTS/link.txt'
        }
    ],
    to: "vikirockz456@gmail.com"
}, function(error, info) {
    if (error) {
        return console.log(error);
    }
    console.log('Message %s sent: %s', info.messageId, info.response);
    console.log("Mail sent successfully");
});

SEE THE ERROR BELOW: Error image

The Archetypal Paul
  • 41,321
  • 20
  • 104
  • 134

1 Answers1

0

Can you please go through this question : Nodemailer Error Can't Fix Maybe your version of node changed knowingly or unknowingly. It seems your version of node is not compatible with nodemailer.

TGW
  • 805
  • 10
  • 27