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

390
Views
nodemailer no envía correo electrónico node.js

Tengo esta función completa, que se supone que debe enviar un correo electrónico, sin embargo, está enviando un error:

 var email = req.query.email; var name = req.query.name; var trainername = req.query.trainername; var sessionDate = new Date().toLocaleString(); console.log(email) console.log(name) console.log(trainername) console.log(sessionDate) // async..await is not allowed in global scope, must use a wrapper async function main() { // Generate test SMTP service account from ethereal.email // Only needed if you don't have a real mail account for testing let testAccount = await nodemailer.createTestAccount(); // create reusable transporter object using the default SMTP transport let transporter = nodemailer.createTransport({ host: "smtp.gmail.com", port: 587, secure: false, // true for 465, false for other ports auth: { user: "myemail@gmail.com, pass: "1234567890", }, }); let supportNumber = Math.random().toString(36).substring(7); console.log("support number", supportNumber); // send mail with defined transport object let clientEmail = await transporter.sendMail({ from: "mm@mm.com", // sender address to: "g@rr.com", // list of receivers subject: "Today's class conformation", // Subject line text: "Hi " + name + ", \n\n Your class with '" + trainername + " has been completed. This message is being sent at: " + sessionDate, // plain text body }); console.log("Message sent: %s", clientEmail.messageId); // Message sent: <b658f8ca-6296-ccf4-8306-87d57a0b4321@example.com> // Preview only available when sending through an Ethereal account console.log("Preview URL: %s", clientEmail.getTestMessageUrl(info)); // Preview URL: https://ethereal.email/message/WaQKMgKddxQDoou... } main().catch(console.error); res.redirect("/dashboard");

aquí está el error:

 Error: connect ETIMEDOUT 13.49.22.0:443 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) { errno: -60, code: 'ETIMEDOUT', syscall: 'connect', address: '13.49.22.0', port: 443, type: 'FETCH', sourceUrl: 'https://api.nodemailer.com/user' }

¡pero no puedo averiguar qué está mal con mi código! He usado este código exacto antes. Supongo que hay algún problema con mi PUERTO, pero no puedo pensar en el problema. ¿Alguien ve algo malo?

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!