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
This article was previously published under Q323928
This article has been archived. It is offered "as is" and will no longer be updated.
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.
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.
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.
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.
For 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
OutSol OutSol98 OutSol2000 OutSol2002
Article ID: 323928 - Last Review: 12/07/2015 11:22:26 - Revision: 4.2
Microsoft Outlook 98 Standard Edition, Microsoft Outlook 2000 Standard Edition, Microsoft Outlook 2002 Standard Edition
- kbnosurvey kbarchive kbpermissions kbemail kbsendmail kbprogramming kberrmsg kbprb KB323928