When using xp_sendmail within a trigger or a stored procedure called by a trigger, I need to isolate any errors caused by the sendmail dll so that it doesn't kill the entire transaction.

For example, if the recipient is invalid, I still need the transaction that called the trigger to complete properly regardless of whether the actual email was sent.

I have been looking for weeks for a solution and can't find it! Help!

JohnnyMurrayNew Member

06 Aug 2004 06:39 AM

I was just scanning for xp_sendmail issues. One nasty one just cropped up on Production causing some rediculously complex SP's to fail.

I don't believe there is a way to trap the sendmail errors. I've seen some work-arounds that suggest running the mail call in a loop. I tried that but still got the error message and ruined the processing.

Barring anything else popping up in this forum, I going for the third-party solution. I don't want to be the first to install a MS Hotfix on my prod box... The KB article I was viewing on this subject is at http://support.microsoft.com/?kbid=833045.