2

im trying to send an email with nodemailer but i get this error

> Error: self signed certificate
>     at TLSSocket.onConnectSecure (_tls_wrap.js:1515:34)
>     at TLSSocket.emit (events.js:400:28)
>     at TLSSocket._finishInit (_tls_wrap.js:937:8)
>     at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:709:12) {   code: 'ESOCKET',   command: 'CONN' }

This is my code

async function sendEmail({ from, to, subject, html }) {
  try {
    const transporter = nodemailer.createTransport({
      host: mailer.host,
      port: mailer.port,
      secure: false,      
      tls: {
    ciphers: 'SSLv3',
        rejectUnauthorized: mailer.tls
      },
    });

    const info = await transporter.sendMail({ from, to, subject, html });

    console.log(info);
  } catch (error) {
    console.log(error);
  }
}

someone can help me please

  • https://stackoverflow.com/questions/46742402/error-self-signed-certificate-in-certificate-chain-nodejs-nodemailer-express – 1sina1 Feb 02 '22 at 21:01
  • thank u for the awnser, im already read it, but does not the same problem, also the issue is diferent my error code is 'esocket' – Antonio Matheus Feb 03 '22 at 14:29

0 Answers0