Author: otherjugdish | Posted on: 7/13/2009 3:31:11 PM | Views : 303

I have a page where a user can enter people's names and email addresses, and then clck a button to send them an invitation email. I have set it up to successfully send the email if the address is an available mailbox, but it fails if the mailbox is unavailable. I want to account for this in my code, and let the user know that they may have entered it incorrectly.
I have been working on exception handling today and I cannot get it right. In my button click event, I create the email and then loop through a returned SQL dataset to get the email addresses of the recipients. I then use a try...catch to send the message. When an address is incorrect, it throws a "Transaction Failed" exception and the server responds: "Sorry, no mailbox here by that name." Other correct addresses are sent correctly, of course.
What I was expecting was a status code of MailboxUnavailable, and I could report that to the user and they could check the address t ...

Go to the complete details ...