XP_sendmail started failing

  • Hi,

    I have few jobs that runs xp_sendmail procedure in a job and sends out differnt results and/or files to users. We rebooted machine this morning. And now all the job that runs XP_sendmail is failing. I get this error message in job history.

    xp_sendmail: failed with mail error 0x80004005 [SQLSTATE 42000] (Error 18025).

    I tried to run xp_sendmail from QA. and I am getting this error message.

    Server: Msg 18025, Level 16, State 1, Line 0

    xp_sendmail: failed with mail error 0x80004005.

    I tried to run this as different users and tried to send email to differnt people, same thing.

    As far as the service account goes, we have a domain admin account for sql server and sql agent services. and it was configured properly, since we are using this for more than 2 years now.

    Any help will be appreciated.

    Thanks.

  • Did you isntall anything to the machine recently, SQL Server service pack, security fix?

    Check the version of sqlmap70.dll in binn folder of SQL Server directory.

  • Have you tried issuing a xp_stopmail then xp_startmail? Failing that, is it possible someone changed the properties of the Domain Admin account? Hope this helps.

    My hovercraft is full of eels.

  • I ran xp_stopmail and xp_startmail as per your advice,sswords. And it worked!!..I am able to run all of those xp_sendmail again.

    Thanks for your help.

  • that problem usually happens when the MAPI Session was lost in the email server. e.g. In case the email server is rebooted.


    * Noel

  • For this reason, I would also avoid xp_sendmail in SQL Server jobs. I've seen such a hang prevent scheduled jobs from executing. There are other options. I believe this site has a script for SMTP mail. With SMTP mail, you can get an error message and retry later if desired - better than just hanging. It's more work. I don't understand why xp_sendmail has not been replaced or "fixed" yet.

    RandyHelpdesk: Perhaps Im not the only one that does not know what you are doing. 😉

  • Hi all,

    Firstly apologies for my previous post, I accidently posted it (amateurs mistake I guess!!!! 🙂

    I've been reading this forum for a while now, and thought it's time to start participating. I'm a sql DBA and am experiencing same problem in a clustered environment.

    We have a 2 node cluster running sql 2000 SP3a (ja I know! what are we still doing using SP3!!!) A while ago we had encountered a problem where the xp_sendmail would periodically stop working (for unknown reasons). The fix implemented by the previous DBA was to create a batch file with the following syntax, which was run daily in a nightly SQL job:

    isql -E -Q"xp_stopmail"

    rem net stop sqlserveragent

    rem net start sqlserveragent

    isql -E -Q"xp_startmail"

    This restarts the sqlmail and initially it appeared to had fixed issue 1, but had brought 2 problems to the table. every month or so the cluster would occasionally fail but never failover to the standby node. 2nd problem was that the sql agent stopped working properly and would cause all maintenance jobs to fail when the cluster failed. To get the sql agent to function properly both nodes need to be rebooted. I have identified that the cause is the script posted above.

    I have read this article: http://support.microsoft.com/kb/833045

    which had outlined a problem with SP2 and SP3. Apparently SP4 solves this xp_sendmail issue (the root of my problem).

    I would like to find out wether anyone had similar issue which was solved with SP4 before I apply it.

    Also, is there an alternative to restart the sqlmail, other than xp_stopmail \ xp_startmail?

    We are running a 2 node cluster with Win Server 2003 SP1, SQL Server 2000 SP3a.

    Martin

    SELECT * FROM users WHERE clue > 0 = 0 rows returned

  • This fix (xp_stopmail then xp_startmail) also worked for me when I had trouble sending routine mails to an external company following a "mailbox migration" exercise.

    😛

  • I also periodically got this error. On 2000 SP4.

    but the xp_stopmail/xp_startmail worked like a champ!

    Thanks

  • xp_stopmail then xp_startmail has just fixed my mailout to externals problem too. Thanks for the tip.

Viewing 10 posts - 1 through 9 (of 9 total)

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