Why can't you send multiple emails asynchronously using the same SmtpClient instance?
What it says on the t开发者_运维问答in.
According to the MSDN page on SmtpClient, the only purpose for SendAsync is to allow your current thread to continue processing instead of waiting for the transmission to process. The purpose of SendAsync isn't to allow you to send multiple messages at once, it's to allow you to continue processing while it sends the message. SendAsync and Send are both using the same pipeline, SendAsync just allows you to do other things while the message is sent.
According to MSDN:
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 you could reuse the same instance but you must wait for the first mail to be sent.
精彩评论