We still don't have a correct answer. I have email forms coming for my website from "[email protected] on behalf of [email protected]", as en example.
When you manually click within Outlook to reply, it correctly identifies the correct recipient, ie the Gmail address and NOT [email protected].
Now, how to reproduce this with a a VB Macro in Outlook as I have a few job application reply templates I want to choose from (ie job rejection, or more info etc), and I everything else works and displays correctly, just NOT the correct recipient email address.
I have this:
Sub RejectionEmail()
Dim origEmail As MailItem
Dim replyEmail As MailItem
Set origEmail = Application.ActiveWindow.Selection.Item(1)
Set replyEmail = Application.CreateItemFromTemplate("C:\Users\Daniel\AppData\Roaming\Microsoft\Templates\Rejection.oft")
replyEmail.To = origEmail.Sender
replyEmail.CC = origEmail.CC
replyEmail.HTMLBody = replyEmail.HTMLBody & origEmail.Reply.HTMLBody
replyEmail.Display
End Sub
I have tried "replyEmail.To = origEmail.SenderEmailAddress" also, no go.
What is the ORIGINAL script Outlook uses to make this work I wonder?