Ramesh Lakshman
Ramesh Lakshman

Reputation: 31

self signed certificate in certificate chain node js?

code snippet for nodemailer and gmail

var transporter = nodemailer.createTransport({
        host: 'smtp.gmail.com',
        port: 465,
        secure: true,
        // service: 'Gmail',
        auth: {
            user: 'mail_id', 
            pass: 'password'
        }

});

Please help find the mistake for solving the issue - self signed certificate in certificate chain

Upvotes: 0

Views: 924

Answers (1)

Ramesh Lakshman
Ramesh Lakshman

Reputation: 31

You want reconfigure your code like below

var nodemailer = require('nodemailer');
var smtpTransport = require('nodemailer-smtp-transport');

var transporter = nodemailer.createTransport(smtpTransport({ host: 'smtp.gmail.com', port: 465, secure: true, // service: 'Gmail', auth: { user: 'your mail_id', pass: 'Your password' }, tls: { rejectUnauthorized: false } }));

Upvotes: 1

Related Questions