Results 1 to 6 of 6
  1. #1
    Join Date
    May 2004
    Posts
    3

    Unanswered: xp_sendmail: failed

    I'm using SQL 2000 with SP 3 installed. Before a power fail two days ago, I can send mail with my server, and now I got the follow error message when I tried to send mail with:

    EXEC master.dbo.xp_sendmail
    @recipients = '<an email address>',
    @message = 'test',
    @subject = 'test'

    => xp_sendmail: failed with mail error 0x80004005

    Please help.
    Al

  2. #2
    Join Date
    Apr 2004
    Location
    Kansas City, MO
    Posts
    734
    Run this from the master database.

    EXEC xp_stopmail
    EXEC xp_startmail

    Try your xp_sendmail again. Let us know if that works.
    MeanOldDBA
    derrickleggett@hotmail.com
    When life gives you a lemon, fire the DBA.

  3. #3
    Join Date
    May 2004
    Posts
    3

    Unhappy still not working, derrickleggett

    After I ran:
    EXEC xp_stopmail
    EXEC xp_startmail

    I got:
    Stopped SQL Mail session.
    SQL Mail session started.
    Server: Msg 18025, Level 16, State 1, Line 0
    xp_startmail: failed with mail error 0x8004011d

  4. #4
    Join Date
    Apr 2004
    Location
    Kansas City, MO
    Posts
    734
    You need to login with the account that runs SQL Server and SQL Server Agent. Open up outlook and see if you get this error when you pull up the mailbox. I believe this error is from the mailbox not being set up correctly, although I don't have time to research right now.

    If that doesn't work, you need to reboot and try it again. If that doesn't work, talk to the Exchange administrator because they messed up the account.
    MeanOldDBA
    derrickleggett@hotmail.com
    When life gives you a lemon, fire the DBA.

  5. #5
    Join Date
    May 2004
    Posts
    3

    My conclusion

    When I ran the following script in Query Analyzer:

    EXEC master.dbo.xp_startmail
    EXEC master.dbo.xp_sendmail
    @recipients = '<e-mail address>',
    @message = 'test',
    @subject = 'go-to-eat.com notice'

    I got:
    "Mail sent."

    But actually the @recipients would not receive the mail.

    When I tried open Outlook (2002), I got:

    "Cannot Start Microsoft Outlook. The file E:\Documents and Settings\alo\local ettings\Application Data\Microsoft\Outlook\outlook1.pst is in use and could not be accessed. Close any application that is using this file, and then try again."

    After I Stop the server with SQL Server Service Manager, I can open Outlook. Once the Outlook opened, the mail I sent earlier can be received. After that, I Start the SQL server again. Then I ran the following script in Query Analyzer again:

    EXEC master.dbo.xp_startmail
    EXEC master.dbo.xp_sendmail @recipients = '<e-mail address>',
    @message = 'test', @subject = 'go-to-eat.com notice'

    I got the following error message:
    "SQL Mail session is already started.
    Server: Msg 18025, Level 16, State 1, Line 0
    xp_sendmail: failed with mail error 0x80004005" !

    Even I close the Outlook, I still got the same error message:

    "Server: Msg 18025, Level 16, State 1, Line 0
    xp_sendmail: failed with mail error 0x80004005"

    Then I Stop and Start the SQL server again, then I got:
    "SQL Mail session is already started. Mail sent." ?!

    But the @recipients would not receive the mail just like earlier.

    When I tried open Outlook again, I got the same error message as above.

    My conclusion:

    If Outlook is closed, xp_sendmail does not send out message, yet show 'mail sent'.
    If SQL server is Started, Outlook cannot be open (cause the same pst file is in use).
    If I Stop the server, I can open Outlook.
    If I Outlook is Opened:
    (1) previous sent message can be sent out;
    (2) run xp_sendmail in QA will got 'xp_sendmail: failed with mail error 0x80004005' error message.
    Even when I closed Outlook now, I will receive the same error message.

    derrickleggett, thks for spend time on my problem; may be u're right that I messed up the account in Outlook, I'm not using Exchange.

  6. #6
    Join Date
    Apr 2004
    Location
    Kansas City, MO
    Posts
    734
    Create a new account in your mail server. Create a new profile to use that account in Mail on Control Panel. Change that to be the default profile when you open Outlook logged in as the SQL Server service user.

    Stop and restart SQLMail. That will eliminate the profile being an issue.
    MeanOldDBA
    derrickleggett@hotmail.com
    When life gives you a lemon, fire the DBA.

Posting Permissions

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