Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

206
Views
No puedo enviar correos electrónicos con Nodejs

Estoy usando nodemailer así:

 const from = "info@my_domain.com"; const to = 'some_mail@gmail.com'; const subject = 'my subject'; const html = '<b>Hello world</b>'; const smtpOptions = { "host": "mail.my_domain.com", "port": 587, "secure": false, "auth": { "user": "info@my_domain.com", "pass": "12345679" }, } const transporter = nodemailer.createTransport(smtpOptions); try { const a = await transporter.sendMail({ from, to, subject, html }); } catch (err) { console.log(err); }

y me sale este error:

Error: certificado autofirmado en TLSSocket.onConnectSecure (nodo:_tls_wrap:1532:34) en TLSSocket.emit (nodo:eventos:527:28) en TLSSocket._finishInit (nodo:_tls_wrap:946:8) en TLSWrap.ssl.onhandshakedone (nodo:_tls_wrap:727:12) { código: 'ESOCKET', comando: 'CONN' }

aunque tengo un ssl válido y después de algunas investigaciones se me ocurrió agregar esta línea a smtpOptions:

 tls: { rejectUnauthorized: false }

¡Ahora no recibo el error pero no se envía ningún correo electrónico!

¿Por qué recibo este error y cómo solucionarlo para que simplemente pueda enviar correos electrónicos?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!