Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

133
Visualizações
am finding this error in my node express application its saying a function have named it sendMailer is not a function. this is when i trigger sent

the error

that is the error now its saying that sendEmail function is not a function have done everything even changing the function format but its saying same error have been doing this the whole day with any solution that have gotten let me give the code of the function


 

async function sendEmail(emailOptions) {
 try{
 
   let emailTransporter = createTransporter();

    emailTransporter.sendMail(emailOptions);
 
 }catch(err){
   console.log(err)
 
 }
 
 };

module.exports = sendEmail
 

where am declaring the function.. am calling it in another file where i add some parameters in the function as seen in the code below


    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 Respostas
Responde à pergunta

0

This type of export function is for arrow functions.

You should export function as follows:

module.exports = sendEmail();
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda