How to send email from secondary email address without setting up a second account?

30,861

You can use .SentOnBehalfOfName property of outlook to send mail in the name of other user. Check the following code and URL for further details: http://www.slipstick.com/developer/code-samples/send-email-address-vba/

oMail.SentOnBehalfOfName = "[email protected]"
Share:
30,861
Mike Marshall
Author by

Mike Marshall

I'm a Sales Analyst and Salesforce Integration Specialist. I started this phase of my career by building custom business solutions in Excel, then learned SQL, and am now learning Apex SOQL in the Salesforce environment.

Updated on October 28, 2021

Comments

  • Mike Marshall
    Mike Marshall over 2 years

    I am using Excel 2010 on W7 x64, to send email from Outlook using code from Ron de Bruin. I have an individual and group email address that I send from.
    I want to send from the group address by changing it in VBA.

    The secondary address is not set up as an actual account in Outlook. If I go to File - Account Settings in Outlook, there is only one email account listed.

    The group email address simply forwards to the group.

    I created an actual account for the group box.
    I added the reference to Microsoft Outlook Object Library in VBA, and added the code to select between account 1 or 2 using the MailItem.SendUsingAccount property, but Outlook would freeze up when trying to send from this address.

    I can manually select between my Individual and Group email in the from dropdown box in Outlook when I send emails.
    Is there a way to do this in VBA without setting up a second account?

  • Mike Marshall
    Mike Marshall over 9 years
    This is exactly what I needed. Thank you!
  • niton
    niton almost 3 years
    Many are not aware of the difference between addresses and accounts. Outlook looks the same whether there is one account with multiple addresses or there are multiple accounts. The question post states. "The secondary address is not set up as an actual account in Outlook." The question is "Is there another way to do this in VBA without setting up a second account?".