Is it possible to programmatically forward or copy an email to a different address but make it come from the original sender, not my own Outlook address. This would be done as a macro in VBA Outlook (desktop). So if [email protected] sends a mail to me, I want it to forward to [email protected], as if [email protected] had sent it. Please see my attempts below. It goes into the outbox from the original sender, but once actually sent, it looks like it came from me.
Sub SendEmail(objMail As Outlook.MailItem)
Dim oMail As MailItem
Dim originalSender As String
On Error GoTo Release
If objMail.Class = olMail Then
' Forward the original email instead of creating a new mail item
Set oMail = objMail.Forward
oMail.Subject = objMail.Subject
oMail.Recipients.Add "[email protected]"
' Preserve the original sender information
originalSender = "<p><b>Original Sender:</b> " & objMail.SenderName & " (" & objMail.SenderEmailAddress & ")</p><br><br>"
oMail.HTMLBody = originalSender & objMail.HTMLBody
' Attempt to send on behalf of the original sender
oMail.SentOnBehalfOfName = objMail.SenderEmailAddress
' Send the email
oMail.Send
End If
Release:
Set oMail = Nothing
End Sub
Sub SendEmail(objMail As Outlook.MailItem)
Dim oMail As MailItem
Dim originalSender As String
On Error GoTo Release
If objMail.Class = olMail Then
' Forward the original email instead of creating a new mail item
Set oMail = objMail.Forward
oMail.Subject = objMail.Subject
oMail.Recipients.Add "[email protected]"
' Preserve the original sender information
originalSender = "<p><b>Original Sender:</b> " & objMail.SenderName & " (" & objMail.SenderEmailAddress & ")</p><br><br>"
oMail.HTMLBody = originalSender & objMail.HTMLBody
' Attempt to send on behalf of the original sender
oMail.SentOnBehalfOfName = objMail.SenderEmailAddress
' Send the email
oMail.Send
End If
Release:
Set oMail = Nothing
End Sub
Howard Selfe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.