Why can SmtpClient.SendAsync only be called once?

前端 未结 7 1309
暗喜
暗喜 2021-02-02 11:22

I\'m trying to write a notification service (for completely legit non-spam purposes) in .NET using SmtpClient. Initially I just looped through each message and sent it, however

7条回答
  •  失恋的感觉
    2021-02-02 11:50

    According to the documentation:

    After calling SendAsync, you must wait for the e-mail transmission to complete before attempting to send another e-mail message using Send or SendAsync.

    So to send multiple mails at the same time you need multiple SmtpClient instances.

提交回复
热议问题