0
votes

I have on account "[email protected]" configured in Outlook 2010. I compose a message and open the drop-down on "From:". I select "Other email address..." and type in "[email protected]". I get a pop-up asking whether to send messages from "[email protected]" via the "[email protected]" account. I "ok" that. When I now send a message to "[email protected]", the recipient sees

From: [email protected]

Curiously, when I go to inspect [email protected]/Sent Items, all I see is

From: [email protected]

I am very frustrated about this behaviour because I wish to move sent items depending on the sending account. Initially I looked into creating a Send Rule. Irritatingly, there is no option to action anything based on "From:". So I dive into VBA. I got most of the code to move the stuff, but when I look through the mail item object (in the Locals window), I cannot find any property that states "[email protected]".

Can anyone advise how to extract the Reply-To (I guess it is) address from the outgoing mail item?

It is quite bizarre that an Outlook recipient of this email will see

From: [email protected] sent on behalf of [email protected]

but the SendOnBehalf property in the Outlook mail item simply reads "[email protected]".

Any advice much appreciated. Thanks.

1
I would have guessed you could find it in mailobject.Sender or mailobject.ReplyRecipients (a collection). What do they say?Olle Sjögren
Thanks. Sender says "[email protected]" and ReplyRecipients has no items at all, rather surprisingly.Ollie2893

1 Answers

0
votes

Try setting SentOnBehalf like this

Option Explicit

Sub SetSentOnBehalf()

Dim objMsg As MailItem

Set objMsg = Application.CreateItem(0)

objMsg.SentOnBehalfOfName = "[email protected]"

objMsg.Display

MsgBox " SentOnBehalfOfName in the From: " & objMsg.SentOnBehalfOfName

Set objMsg = Nothing

End Sub