Outlook auto forward set replyto to orginal sender rather than forwarder

空扰寡人 提交于 2019-12-24 04:40:17

问题


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

回答1:


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 .SenderEmailAddressas this property is readonly.

Having said that there is another property that you may like to use. .SentOnBehalfOfName More details here

Topic: SentOnBehalfOfName Property

Link: http://msdn.microsoft.com/en-us/library/aa171998%28v=office.11%29.aspx

Quote from the above link

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

Topic: Automatically setting the ‘From’ address of a new Outlook message

Link: http://benchristian.wordpress.com/2005/12/18/automatically-setting-the-from-address-of-a-new-outlook-message/

Quote from the above link

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




回答2:


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.



来源:https://stackoverflow.com/questions/10528075/outlook-auto-forward-set-replyto-to-orginal-sender-rather-than-forwarder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!