C#C
C#14mo ago
32 replies
Bulelani Botman

How To Properly Catch An SMTPException & IOException

Hi, everyone. I have a project that sends emails to clients and also saves a copy of the email but somewhere during the operation of sending these emails, I get an IOException & sometimes an SMTPException for a particular email & it breaks the server & gives me a "Error 500"

I want to properly handle an exception when happens, like retry sending that email again or just move on to the next or maybe log it (If logging that error is the way, I want a way for the problem to appear on Event Viewer). How would I achieve that. Here is the code link
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Was this page helpful?