
I have VBA code to forward email to a specific account. It works except email being forwarded has the forwarder's email address.
How can I keep the original sender email address as the replyto after an email is forwarded?
Sub AutoForwardAllSentItems(Item As Outlook.MailItem)
Dim strMsg As String
Dim autoFwd As Outlook.MailItem
Set autoFwd = Item.Forward
autoFwd.Recipients.Add "my_email@domain.com"
autoFwd.Send
Set autoFwd = Nothing
End Sub
Answer1:
so there is no way? really? – Mike 7 hours ago
Riking is correct when he mentioned that Outlook will not let you modify the headers included in the email. I am guessing that he is refering to .SenderEmailAddress
property. You cannot modify the .SenderEmailAddress
as this property is readonly.
Having said that there is another property that you may like to use. .SentOnBehalfOfName
More details here
<strong>Topic: SentOnBehalfOfName Property</strong>
<strong>Link</strong>: http://msdn.microsoft.com/en-us/library/aa171998%28v=office.11%29.aspx
<strong>Quote from the above link</strong>
Returns a String indicating the display name for the intended sender of the mail message. This property corresponds to the MAPI property PR_SENT_REPRESENTING_NAME. Read/write.
expression.SentOnBehalfOfName
expression Required. An expression that returns a MailItem object.
Also see this link
<strong>Topic: Automatically setting the ‘From’ address of a new Outlook message</strong>
<strong>Link</strong>: http://benchristian.wordpress.com/2005/12/18/automatically-setting-the-from-address-of-a-new-outlook-message/
<strong>Quote from the above link</strong>
Setting an alternate reply address is particularly useful if you are using a mail enabled public folder or distribution list for a group of users and would like the replies to messages that they send to go to the group smtp address instead of the sender’s mailbox.
HTH
Answer2:
Everything I've seen so far supports the conclusion that Outlook will not let you modify the headers included in the email.
Sorry. I'd suggest managing the forwards at the email provider, if that is an option for you.