I have code for sending an email. I set a value in my config file for that would throw an smtpfailedrecipient exception. This exception is being thrown but it isn't reaching the catch block.I get an smtpfailedrecipientexception that is at the send method in the try block. The error says that the "exception was unhandled by user code". I don't understand why the catch block isn't being reached. I thought this would be reached in this situation. I thought this is what the catch block was for.Can someone please help me understand how to design this better or why this isn't working the way I thought it would? try
{
client.Send(message); <-- this throws the exception
}
catch (SmtpFailedRecipientsException ex)
{
#region Catch logic
for (int i = 0; i < ex.InnerExceptions.Length; i++)
{
SmtpStatusCode status = ex.InnerExceptions[i].StatusCode;
if (status == SmtpStatusCode.MailboxBusy ||
status == SmtpStatusCode.MailboxUnavailable)
{
lblMessage.Visible = true;
lblMessage.Text = "Deli
View Complete Post