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

929
Views
Los correos electrónicos de Nodemailer Ethereal no se envían a Gmail

Estoy tratando de enviar correos electrónicos usando la siguiente función usando el servidor express js. Parece estar funcionando bien. Pero cuando envío un correo electrónico, no se ve en mi bandeja de entrada de Gmail ni en los correos no deseados.

Función que usé:

 const transporter = nodemailer.createTransport({ host: 'smtp.ethereal.email', port: 587, auth: { user: 'leo.skiles74@ethereal.email', pass: 'BJkKV41tNZNBmMkkCw' } }); function SendEmail(email,subject,text,html) { return new Promise(async (resolve, reject) => { try { let info = await transporter.sendMail({ from: "leo.skiles74@ethereal.email", to: email, subject: subject, text: text, html:html }) resolve(info) } catch (error) { reject(error) } }) }

Respuesta recibida:

 { "accepted": [ "gayantaanus@gmail.com" ], "rejected": [], "envelopeTime": 759, "messageTime": 506, "messageSize": 596, "response": "250 Accepted [STATUS=new MSGID=YpXX5N-8J14cOJVHYpXjvw93heVfMHMGAAAAA4okSTkzId5ci.tBPvM2244]", "envelope": { "from": "leo.skiles74@ethereal.email", "to": [ "gayantaanus@gmail.com" ] }, "messageId": "<91f5d48e-a363-b59a-d47b-c44736e49c43@ethereal.email>" }

Pero no entregado a gmail. ¿Cómo solucionarlo y explicarme el motivo?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Esta es la forma:

 const nodemailer = require("nodemailer"); nodemailer.createTestAccount((err, account) => { if (err) { console.error("Failed to create a testing account. " + err.message); return process.exit(1); } console.log("Credentials obtained, sending message..."); let transporter = nodemailer.createTransport({ host: account.smtp.host, port: account.smtp.port, secure: account.smtp.secure, auth: { user: account.user, pass: account.pass, }, }); let message = { from: "Sender Name <sender@example.com>", to: "Recipient <recipient@example.com>", subject: "Nodemailer is unicode friendly ✔", text: "Hello to myself!", html: "<p><b>Hello</b> to myself!</p>", }; transporter.sendMail(message, (err, info) => { if (err) { console.log("Error occurred. " + err.message); return process.exit(1); } console.log("Message sent: %s", info.messageId); console.log("Preview URL: %s", nodemailer.getTestMessageUrl(info)); }); });
over 4 years ago · Santiago Trujillo Report
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!