Share via


xp_sendmail query failing with Msg 17925, Level 16, State 1, Line 0

Problem Description 

Xp_sendmail task in SQL Serevr 2005 might not work on a cluster after upgrading the Exchange to 2007 from Exchange 2003
SQL 2000 SQL mail works with same Exchange 2007 MAPI Profile without any issues
Though as a SQL agent jobs the emails are sent fine for SQL MAIL feature without any issues with the same MAPI profile as a JOb alert, the problem is with only the xp_sendmail funtionality

Cause:

Issues with the Default MAil profile called Outlook which might be corrupt

Error Message

Msg 17925, Level 16, State 1, Line 0
xp_sendmail: failed with mail error 0x80004005

Resolutin Section

-> Try to restart the SQL Server service and see if that taks care of the problem or not.

-> Test whether from the Box where the Outlook Exchange been upgraded can send emails to users or not?

-> Check the SQL server service Startup account credentials used for sending the email using xp_sendmail has got sysadmin privileges. Also make sure that the MAPI outlook profile is been created with same account as well the MAPI profile been using the same account as that off the SQL Server startup account

 Check the Pre-requisite list again
 =========================
  
-> For SQL Mail to work we need to configure the mail profile with the SQL Server service account.

-> Running the xp_sendmail under the SQL Server service account which is another requisite {and this account is a Sysadmin}

-> No shared MAPI profile there enabled

-> Fire xp_stopmail and then fire xp_starmail and see if that helps

-> If none of the above ones work follow the process:

1) Go ahead and close Outlook

2) Then got to Control Panel-> Look for Adminitrative tools-> MAIL-> create a New Profile then delete the default Profile Outlook

3) Change the setting on SQLMAIL properties from SSMS and changed it to use NEW MAPI profile and also changethe SQL Server agent Jobs alert system to use the new profile

4) Once the above was done we went ahead and fire

   xp_stopmail and xp_startmail
  
-> After that fired xp_sendmail and that worked.

-> On a cluster please do the same steps on every node and for standalone on the same box.