Results 1 to 2 of 2

Thread: xp_sendmail error handling?

  1. #1
    Darin Drewrey Guest

    xp_sendmail error handling?

    Hello all.

    I have a stored procedure that loops through a customer list and email the customer via xp_sendmail. My problem is that if there is a bad email address, the sproc ends right there.

    Is there a way to trap for xp_sendmail errors so my sproc won't fail? I didn't see anything in BOL.

    Thanks.


  2. #2
    Steve Guest

    xp_sendmail error handling? (reply)

    Is there any return code from the SP? I would also like to know if this is called on demand or as a task. If it is a task, then there should be success or failure in the syshistory table. I would think that an SP that terminates unexpectedly would have a return code of some sort.

    In general, I keep my xp_sendmail SPs separate from the processing SPs for this reason. I would use a temp table and call an SP that only sends mail. That way you could keep track of which items are completed. You can also continue to run if the sendmail fails for a particular item.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •