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

123
Views
estoy encontrando este error en mi aplicación node express que dice que una función la ha llamado sendMailer no es una función. esto es cuando activé el envío

el error

ese es el error, ahora dice que la función sendEmail no es una función, he hecho todo, incluso cambiando el formato de la función, pero dice que el mismo error ha estado haciendo esto todo el día con cualquier solución que haya obtenido, déjeme dar el código de la función

 async function sendEmail(emailOptions) { try{ let emailTransporter = createTransporter(); emailTransporter.sendMail(emailOptions); }catch(err){ console.log(err) } }; module.exports = sendEmail

donde estoy declarando la función ... la estoy llamando en otro archivo donde agrego algunos parámetros en la función como se ve en el código a continuación

 const sendEmail = require('./nodemailer'); async function sendConfirmationEmail (url, email) { try { const emailOptions = { from: `" Perez Food Delivery" <${process.env.USER}> `, to: email, subject: "Comfirmation of account ", html: ` <div style= "max-width:600px; margin: 0 auto;"> <h1 style="text-align: center; color: #5f6368; padding-bottom: 20px; ">welcome!</h1> <p style=" margin: 0; font-size: 16px; "> </p> <div style="width: fit-content; margin: 40px auto; " ><a href="${url}" target="_blank" style=" font-size: 16px; font-family: Helvetica,Arial,sans-serif; color: #222; cursor:pointer; text-decoration: none; padding: 10px 20px; border: 2px solid #202124; background: #fcba1c; font-weight: 600; display: inline-block;">comfirm here</a></div> <p style=" margin-bottom:0; font-size: 16px;">please click thebutton to navigate back to the site: </p> <p style="text-align:center; margin:10px 0; font-size: 16px;"><a href="#" target="_blank" style="color: #FFA73B;">${url}</a></p> <p style=" font-size: 16px;">If this request is not made by you kindly ignore this mail..</p> <div> <p style=" font-size: 16px; padding: 30px 0; background: #ffd5a1; color: #5f6368; text-align: center;">with regards, Perez Food Delivery .</p> `, } await sendEmail(emailOptions); } catch (err) { console.log(err); } }; module.exports = sendConfirmationEmail;
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Este tipo de función de exportación es para funciones de flecha.

Debe exportar la función de la siguiente manera:

 module.exports = sendEmail();
about 4 years ago · Juan Pablo Isaza 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!