You may receive the "You do not have the permission to send the message on behalf of the specified user" error message when you send a custom mail message form by using Outlook (323928)
The information in this article applies to:
- Microsoft Outlook 98
- Microsoft Outlook 2000
- Microsoft Outlook 2002
This article was previously published under Q323928 SYMPTOMS
When you try to programmatically send a mail message, you may receive the following error message:
You do not have the permission to send the message on behalf of the specified user.
CAUSE
This issue may occur in a custom mail message form if you use the Send method to programmatically send a mail message after it has arrived in an Inbox. In this case, the From field is already set to the user who sent the message. A permissions error occurs because you do not have permission to send mail on the other user's behalf.
RESOLUTION
When an item is opened from the Inbox or another folder, the item is in read mode instead of compose mode. Microsoft recommends that you do not try to send an item that is in read mode. Instead, use the Outlook object model the same way that the user interface behaves; always create a new item to send. Use one of the following methods to create a new item to send, so that the new item is in compose mode:
- Either use a form action, such as Forward, to create a new item to send, or use the Actions page of the form to create a custom action. This is the preferred method because this method transfers the data in the fields of the original message to the fields of the new item. If you use this method, the message body is also transferred and maintains its formatting.
-or-
- Use the CreateItem or Items.Add method to programmatically create a new item to send. If you use this method, you have to programmatically copy fields from the original message to the new message.
WORKAROUND
To work around this issue, use the SentOnBehalfOfName property to reset the From field. Typically, you have to do so in both the Item_Open and Item_Send events of a custom mail message form. However, if you use this method, behavior may be inconsistent. Therefore, Microsoft recommends that you do not use this method.
REFERENCESFor additional information about available resources and answersto frequently asked questions about Microsoft Outlook solutions, click the article numbers below
to view the articles in the Microsoft Knowledge Base:
287530 OL2002: Questions About Custom Forms and Outlook Solutions
146636 OL2000: Questions About Custom Forms and Outlook Solutions
182349 OL98: Questions About Custom Forms and Outlook Solutions
Modification Type: | Major | Last Reviewed: | 8/19/2004 |
---|
Keywords: | kbpermissions kbemail kbsendmail kbProgramming kberrmsg kbprb KB323928 |
---|
|