xp_smtp_sendmail erroring out, but still sending email without the attachment

  • Hi.  We have a sql job to poll a table for emails needing to be sent, and to call xp_smtp_sendmail to send the email.

    We have a problem with xp_smtp_sendmail, where it will send the email but without the attachment, and crash the job with:

    Error: disconnecting from server mail.xxxxxxxxx.net failed [SQLSTATE 01000] (Message 0).  The step failed.

    When the job runs again, it sends the email again because the step in our sproc to mark the email as gone has not been executed (this step runs after the call to xp_smtp_sendmail).  The second send has the attachment.

    Has anyone ancountered this problem before, and maybe has a solution?

    Thanks!

    Wayne


    When in doubt - test, test, test!

    Wayne

  • xp_smtp_sendmail?

    Where did this come from... aint a standard object

  • It is 3rd party product, quite popular as an alternative too xp_sendmail as it can send HTML mail.

    See http://sqldev.net/xp/sp_smtp_sendmail.htm


    When in doubt - test, test, test!

    Wayne

  • I am having the exact same problem with xp_smtp_sendmail.

    We randomly get the following error...

    Error #-2147467259

    [Microsoft][ODBC SQL Server Driver][SQL Server]Error: disconnecting from server xxx.xxx.xxx.xxx failed

    (Source: Microsoft OLE DB Provider for ODBC Drivers)

    Out of a hundred mails a day, it will throw this error four or five times.

    Any ideas????

  • Not sure if this is of any help, but I was getting the same problem. I managed to fix it by fiddling with the actual content of the mail body!

    Can't remember exactly what I did, but it was something to do with removing certain characters from the mail. It may have been carriage returns or <br> for HTML. Yes, I know it's a rubbish solution, but I could consistently get it to fail with certain text content. A simple change made it work.

    It is NOT related to the text length. I would love to know what was causing the problem. I suspect a new release of the dll would be required to fix it.

     

    David

  • Thanks for the direction.  We save all the statements that fail in a table so we'll be easily able to change the ones that fail until they work.  That should reveal what is causing the problem.

    Will post what we find...

    Thanks...

    Dean

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply