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

186
Views
How to handle multiple emails being sent with nodemailer without blocking main thread

I have an node application with multiple routes and all cases are being handled with asynchronous functions to handle them but I am looking forward for a logic/idea how to proceed when multiple emails are to be sent with respective email content like username, image, etc. with nodemailer (being iterated).

Basically I have an array/object which has all content to send each email address but if I allow to execute then that loop will block the main thread and thus next requests/tasks won't be able to achieve.

Looking forward to get some idea.

Thanks.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can call your function after sending the response.

myController = (req, res, next) => {
   /* some code */

   res.send("OK");
   callMailServicesHere(myArray);

}
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!