Is System.Net.Mail.SmtpClient.Send synchronous?

Given that SmtpClient has a SendAsync method that I don’t use, is it therefore safe to consider StmpClient.Send synchronous? I use it to send email with a temporary file attachment and want to know if I can delete the temporary attachment right away.

Thanks Rob.

+3
source share
3 answers

From msdn documentation : "Sends an email message to the SMTP server for delivery. These methods are blocked when the message is sent.".

So yes, it is synchronous.

+9
source

, "" smtp- , , , . SmtpClient , Smtp .

+3

Yes, it is synchronous.

+2
source

Source: https://habr.com/ru/post/1714894/


All Articles