0

I am trying to send mail from my NodeJS backend application, but am getting some error :-

Error: self signed certificate in certificate chain
  at TLSSocket.onConnectSecure (_tls_wrap.js:1497:34)
  at TLSSocket.emit (events.js:315:20)
  at TLSSocket._finishInit (_tls_wrap.js:932:8)
  at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:706:12) {
  code: 'ESOCKET',
  command: 'CONN'

How can I fix this? The same function is working in some other machines (in local) I think am missing something to configure or install..!

sendMail()  {

try {
        let info = await this.transporter.sendMail({
            from: 'sender@address.com', 
            to: user.email, 
            subject: "Subject", 
            html: `<p>mail content</p>`,
            attachments: [{
                filename: 'logo.png',
                path: join(__dirname, '..images/logo.png'),
            }]
        });
     } catch (error) {
        return console.error(error);
    }

 }
mevr
  • 1,075
  • 3
  • 14
  • 32

0 Answers0