XP_Sendmail

  • I have a windows application that executes xp_sendmail to send e-mail. The app has worked for almost a year. We recently had our exchange server lock up. After the server came back up the xp_sendmail started throwing its common error: xp_sendmail: failed with mail error 0x80004005. The weird thing is that if I try running the same xp_sendmail command in query analyzer it sends fine from the server that the application runs the command on. I did xp_stopmail and xp_startmail and it didn't change anything. What is wrong? Why will it work in query analyzer but not in a .NET application? What could have changed when the server locked up, our IT manager says they didn't change anything on the Exchange server?

    Thanks for the help,

    Adam

  • Sorry, about the problem, I have figured it out.

    Thanks anyway,

    Adam

  • Helpful hint:

    Please post your solution.

    Even though you fixed the problem yourself, your solution may, in fact, help someone else down the road.



    The ~BEST~ solution is always the simplest one!

  • Well the solution isn't very helpful.  Evidently the code in the application was changed to use another server for e-mail, so all I had to do was stop are start SQL Server on the server it was using and that fixed it.

    Thanks, Adam

  • As minor as it may seem...that's still a solution.

    It's usually the simple things that are overlooked when something is causing a problem.

    Many times (myself included) folks take off on the wildest tangents of what could be causing problems, errors, etc.

    Just because it was a simple solution, doesn't make it any less important.

     



    The ~BEST~ solution is always the simplest one!

  • Yes, I agree.  I will post fixes from now on, this one was just hard to post because it showed how I overlooked the simplest solution.

  • Hi Tom and Adam

    I am having the same problem. Can you please tell me how do I start and stop the servie.

    I get this error when I am trying to send mail.

    xp_sendmail: failed with mail error 0x80004005

     

    Any help would be appreciated.

     

    Thanks

  • use xp_stopmail & xp_startmail.......if you need more information about the two stored procedures, you can find info about them in the Books Online

    Let me know if you have any trouble

  • I tried executing Xp_stopmail and xp_startmail , I get the error

    Could not find stored procedure 'xp_startmail'

    Do I need to have any particular permission to execute this .

    Thanks

     

  • It is in the Master Database, so if you are trying to execute it from another database you must use the full path or you will get the error you are receiving.

    Master.dbo.xp_startmail

    Master.dbo.xp_stopmail

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

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