PRB: 0x80070005 or 0x80040005 Error Occurs When You Send E-Mail by Using the Xp_sendmail Extended Stored Procedure (820220)



The information in this article applies to:

  • Microsoft SQL Server 2000 (all editions)

SYMPTOMS

When you use the xp_sendmail extended stored procedure to send e-mail from SQL Mail with SQL Server 2000, you might receive one of the following error messages:

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

-or-


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

CAUSE

The alias name of the Microsoft Exchange 2000 mailbox that is configured for the SQL Mail profile contains special characters such as a period ("."), or the at sign (@). For example, Sql.mail.

WORKAROUND

To work around the problem, create a new Microsoft Exchange 2000 mailbox with an alias that does not contain any special characters, and then configure the mailbox for the SQL Mail profile.

MORE INFORMATION

SQL Mail uses extended MAPI for submitting e-mail messages to the MAPI spooler for delivery (SubmitMessage API call). The SubmitMessage procedure tries to parse the alias name, and it truncates the alias name when the procedure encounters a special character. Because the alias name is truncated, MAPI cannot find a mailbox or security credentials, or both, to match with the mailbox. Hence, you might receive an "access denied", 0x80070005, or 0x80040005 error.

When you use the Microsoft Outlook client on a computer that is running SQL Server, and you use the SQL Server Agent to send e-mail messages, the delivery of the messages is not affected by this configuration. SQL Agent Mail and Microsoft SQL Server 7.0 SQL Mail use the Simple MAPI API call to perform xp_sendmail operations. The Simple MAPI method (MAPISendMail API call) for delivering e-mail is not affected by the special characters.

REFERENCES

For additional information, click the following article numbers to view the articles in the Microsoft Knowledge Base:

293422 PRB: xp_sendmail Using a Microsoft Exchange 2000 Mailbox Fails with Mail Error 0x80004005 or 0x80007005

811035 PRB: The xp_sendmail Stored Procedure Fails with Error 0x80070005 When the Mailbox of the SQL Mail Profile is Different From the MSSQLServer Service Startup Domain Account Default Mailbox


Modification Type:MajorLast Reviewed:5/8/2003
Keywords:kbSQLServMail kberrmsg kbprb KB820220 kbAudDeveloper