How do i send an error e-mail in vb.net? - TechRepublic
Question
August 8, 2011 at 06:30 AM
brian

How do i send an error e-mail in vb.net?

by brian . Updated 14 years, 10 months ago

I have a piece of code written with an insert statement. If the insert statement works, I want to send an e-mail telling certain people the information inserted into the db (which works well). If it fails, I have a try/catch in the code which responds back with an error message on the entering persons screen (which works) and is to send an e-mail to our IT department (which works). Here is the catch…the error e-mail goes out irregaurdless if the insert statement works or not. If the insert goes through, the error message IS NOT displayed on the entering persons screen, yet I still get the error e-mail saying the insert failed, but I also get the e-mail that would be sent if the insert worked. If the insert fails, i get the error written to the screen and the error e-mail only. I have the error e-mail in the try/catch loop to catch the failure, and the “insert worked” email outside of and before the try/catch loop. Any suggestions?

This discussion is locked

All Comments