BUG: SQLMail: sp_processmail Returns Failure Code But No ErrorLast reviewed: May 2, 1997Article ID: Q147165 |
The information in this article applies to:
SYMPTOMSThe sp_processmail procedure will return a value of 1 to indicate failure, however, it does not return any error messages to indicate the cause of the failure. Under some circumstances, sp_processmail may fail to run successfully even though SQLMail is properly set up and there is one or more messages in the inbox to be processed.
CAUSEIf the originator of a mail message in SQL Server's inbox is a mail username that cannot be resolved to a valid mail address, sp_processmail will fail.
WORKAROUNDYou can do one of the following to work around this problem:
STATUSMicrosoft has confirmed this to be a problem in Microsoft SQL Server version 6.0. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATIONYou can tell if the mail username can be successfully resolved to a mail address by running xp_sendmail to send a message to that user. If the username cannot be successfully resolved to a mail address, xp_sendmail will return the following error:
Msg 17921, Level 18, State 1 A recipient was specified ambiguouslyFor example, if there is a mail username of "SQL" and another of "SQL Server," the following command will correctly result in Msg 17921:
EXEC xp_sendmail "SQL", "Test message"This is correct behavior because MAPI is unable to resolve the name "SQL" because it could potentially be resolved to either of the accounts from above. If a user logs in to mail as "SQL" and sends a message to SQL Server, sp_processmail will fail because it attempts to do an xp_sendmail to send a message to "SQL." The correct behavior for sp_processmail would be to use the mail address of the original sender when running xp_sendmail. The mail address would be of the form [MS:network/postoffice/mailbox], such as the following:
EXEC xp_sendmail "[MS:Windows/scotthu/sql]", "Test message" |
Additional query words: sql6
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |