Error: self signed certificate in certificate chain, Node.js Mail Sender
I am developing node js application through which I am trying to send mail from (localhost:3000),
but I am getting error, please help on how do I send mail using node js nodemailer and zoho smtp
I am using nodemailer
Here is the code, how I am creating transporter object
- const nodemailer = require('nodemailer');
- const transporter = nodemailer.createTransport({
- host: "smtp.zoho.com",,
- port: 465,
- secure: true,
- secureConnection: false,
- auth: {
- user: "email@email.com",
- pass: "password"
- }
- });
- obj = {
- from: 'valid@fromemail.com',
- to: 'valid@email.com',
- subject: 'subject',
- text: 'text',
- html: <b>Test HTML</b>
- }
- transporter.sendMail(obj);
I got below error:
- { Error: self signed certificate in certificate chain
- at TLSSocket.onConnectSecure (_tls_wrap.js:1055:34)
- at TLSSocket.emit (events.js:198:13)
- at TLSSocket.EventEmitter.emit (domain.js:448:20)
- at TLSSocket._finishInit (_tls_wrap.js:633:8) code: 'ESOCKET', command: 'CONN' }
-----------------------------------------------------
Its giving error even If I am using non secure connection