.NET SmtpClient: Is there a way to make sure that all emails resolve prior to sending MailMessage?
问题 I am using SmtpClient to send an email to multiple recipients. As employees leave the company, their email addresses become invalid. Since their email addresses remain in our database until deleted manually, trying to send an email to them causes our application to throw an exception during SmtpClient.Send(MailMessage) . However, in spite of the exception being thrown, it still sends the email. This is a problem because we want to handle this error by blocking the user's attempt to save the