Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xp_sendmail not working

Status
Not open for further replies.

JZajda

Technical User
Jan 15, 2002
32
US
We have recently moved and upgraded our Exchange Server to 2003, since this switch the xp_sendmail command is no longer working. We are on SQL Server 2000 SP3 and other email from SQL is working (job notifications and commands from DTS packages). The ones that fail are using xp_sendmail from within stored procedures, they fail with the error:

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

All the information I have found on SQL server mail problems are universal problems with all mail. Does anybody have any insight?

Thanks
-Joy
 
Running into the same issue! Have you made any headway on this issue?

Thanks

J. Kusch
 
I haven't found anything yet, let me know if you do.

Joy
 
OK ... solved my issue. We basically dropped and recreated the MAPI profile account. The NT Admin made sure the appropriate rights were in place. We then let it propogate the Active Directory which took about 15 minutes. I then stopped and restarted SQL Server, and the agent for good measure. It came up working like a champ.

In its current state, are you able to test the profile in Enterprise Manager. I was able to and it came back saying it was able to stop/start/test the profile without a problem.

The error message when I ran a test email script in query analyzer was a big help. The last portion of the error message will return a hex number relating to a specific MAPI issue. Mine came back, and was translated as 'MAPI_E_N)_ACCESS". So I had a rights issue w/ a folder on the Exchange Server.

Hope this gets you a bit further. Please relay what your test results are as well as the specific error message you get back.

Thanks

J. Kusch
 
Here is a quick script ...

Code:
EXEC    MASTER..xp_sendmail
    @Recipients        = 'MyName@MyCom.com',
    @Message        = 'this is a test message',
    @Copy_Recipients    = 'MyName@MyCom.com',
    @Subject        = 'This is the test subject ...'

replace the email addresses w/ valid ones and run this in query analyzer.

Thanks

J. Kusch
 
I found a solution on SQL Server Central that worked for me. Instead of just running the xp_sendmail, I have to stop and start prior to it.


example:

xp_stopmail
xp_startmail
xp_sendmail
@Recipients = 'MyName@MyCom.com',
@Message = 'this is a test message',
@Copy_Recipients = 'MyName@MyCom.com',
@Subject = 'This is the test subject ...'


Thanks for your help
Joy
 
A bit of overhead ... but if it works ... IT WORKS!

Thanks

J. Kusch
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top