Sending email to multiple recipients via nodemailer

后端 未结 8 1800
青春惊慌失措
青春惊慌失措 2020-12-25 11:19

I am trying to send email to multiple recipients. For this I have created an array of recipients, but with my code I am only able to send mail to last email ID of the array

8条回答
  •  春和景丽
    2020-12-25 11:35

    You are sending the emails asynchronously so you need a waiting function that waits for all the mails till they have been sent because if not, you program exits and some of the requests are not fulfilled. So you have to do sort of a timeout function that checks if the emails have been sent.

提交回复
热议问题