Microsoft KB Archive/323928

= You may receive the &quot;You do not have the permission to send the message on behalf of the specified user&quot; error message when you send a custom mail message form by using Outlook =

Article ID: 323928

Article Last Modified on 8/19/2004

-

APPLIES TO


 * Microsoft Outlook 98 Standard Edition
 * Microsoft Outlook 2000 Standard Edition
 * Microsoft Outlook 2002 Standard Edition

-



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.

