Send email from another address using VBA

Last reviewed on October 27, 2012

This is from Send E-mail with VBA code from [E-mail Distribution Group] if I have “Send as”

I need to send message from the certain E-mail address (E-mail Distribution Group) with VBA code. I have permission “Send as” and I can do it by hands, changing field “From”.

You can do this using _MailItem.Sender Property

VBA code Sample

Sub CustomMailMessage_1(Item As Outlook.MailItem)

Dim OutApp As Outlook.Application
Set OutApp = CreateObject("Outlook.Application")

Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient

'Create the message.
Set objOutlookMsg = OutApp.CreateItem(olMailItem)

Set objOutlookRecip = objOutlookMsg.Recipients.Add("me@domaain.com")
objOutlookRecip.Type = olTo

' objOutlookMsg.SenderEmailAddress = "sendas_address@domain.com"
objOutlookmsg.MailItem.Sender = "sendas_address@domain.com"

objOutlookMsg.Subject = "HRU"

'Create the body
objOutlookMsg.HTMLBody = "HRU" & vbCrLf & vbCrLf

objOutlookMsg.Importance = olImportanceHigh 'High importance

'Resolve each Recipient's name.
For Each objOutlookRecip In objOutlookMsg.Recipients
objOutlookRecip.Resolve
Next

objOutlookMsg.Save
objOutlookMsg.Send

Set OutApp = Nothing

End Sub

Written by

Diane Poremsky
A Microsoft Outlook Most Valuable Professional (MVP) since 1999 and involved in IT support since 1985, Diane is the author of several books and video training CDs and online training classes for Microsoft Outlook. You can find her helping people online in Outlook Forums as well as in the Microsoft Answers and TechNet forums.