VBA Send Email From a Different Address in Outlook

VBA & macros · Updated November 3, 2026

VBA Send Email From a Different Address in Outlook

Yes. In classic Outlook for Windows, VBA can send a message from another address when that address is an account in the Outlook profile or you have permission to use its mailbox. Select the account with SendUsingAccount; for a shared or delegated mailbox, SentOnBehalfOfName may be appropriate, but neither property grants permission to send.

What “send from a different address” means

Outlook can have several sender identities, and the right VBA method depends on what the address represents. A second mailbox configured as an account in your Outlook profile is different from an alias attached to your existing mailbox, and both differ from a shared mailbox to which you have delegated access.

With a separate Outlook account, a message can be associated with that account before it is sent. Outlook uses the account’s configured sending service and address. This is generally the cleanest option when the address appears as its own account in Outlook.

A shared mailbox or another person’s mailbox is usually accessed through permissions rather than by adding a separately signed-in account. You may be allowed to send as that mailbox, or only to send on its behalf. Those permissions determine what the recipient sees and what the mail server accepts.

An alias is an additional address for the same mailbox. It may not appear as a separate item in Outlook’s account collection, so selecting an account by its SMTP address will not necessarily select an alias. Whether Outlook lets you send from that alias depends on how the email service and mailbox are configured.

Choose the method that matches the address

  • Separate account in Outlook: Find the matching account in the Outlook profile and assign it to the message’s SendUsingAccount property.
  • Shared or delegated mailbox: Use the mailbox address as the sender only when the administrator has granted the appropriate Send As or Send on Behalf permission. Depending on the setup, SentOnBehalfOfName is used for the delegated sender identity.
  • Alias on your existing mailbox: Check whether your mail service permits sending from that alias and how it expects the From address to be set. It may require an administrator setting or a different sending interface; simply changing a message’s displayed address is not a reliable or authorized workaround.

These methods are not interchangeable. If the requested address cannot be found as an Outlook account, do not assume that writing it into a From field will make the message send as that identity. The server can reject the message, replace the sender, or show the actual account as the sender.

Send from a configured Outlook account with VBA

This Excel VBA example searches the current Outlook profile for a separate account by its SMTP address. It displays the message for review rather than sending it immediately. Change the example address and message details before running it. The code uses late binding, so you do not need to add an Outlook object-library reference in the Excel VBA editor.

Option Explicit

Sub DraftEmailFromChosenOutlookAccount()
    Dim olApp As Object
    Dim olNs As Object
    Dim olAccount As Object
    Dim olMail As Object
    Dim senderAddress As String
    Dim found As Boolean

    ' Use the SMTP address of an account in the Outlook profile.
    senderAddress = "sales@example.com"
    Set olApp = CreateObject("Outlook.Application")
    Set olNs = olApp.GetNamespace("MAPI")

    For Each olAccount In olNs.Accounts
        If LCase$(CStr(olAccount.SmtpAddress)) = LCase$(senderAddress) Then
            Set olMail = olApp.CreateItem(0) ' 0 is an Outlook mail item.
            Set olMail.SendUsingAccount = olAccount

            With olMail
                .To = "customer@example.net"
                .Subject = "Your order update"
                .Body = "Hello, here is the update we discussed."
                .Display ' Review the sender and contents before sending.
            End With

            found = True
            Exit For
        End If
    Next olAccount

    If Not found Then
        MsgBox "That address was not found as an Outlook account."
    End If
End Sub

For example, if the profile contains sales@example.com as an account, the loop assigns that account to the new message. If it does not, the macro reports that it could not find the account and does not display or send a message. The example’s .Display line opens a draft; after you confirm the From account and content, you can send it in Outlook. Replacing .Display with .Send sends without that review, so do so only after the macro has been checked and tested with a safe recipient.

If the macro is running inside classic Outlook VBA rather than Excel, Outlook is already the host application; you can use Set olApp = Application instead of creating an Outlook instance. The rest of the account-selection approach is similar. Outlook must be installed and configured with the intended account for the example to find it.

Using a shared mailbox or sending on behalf

For a shared mailbox, first confirm which permission you have. Send As generally makes the message appear to come directly from the shared mailbox. Send on Behalf identifies the person sending and indicates that they sent the message on behalf of the mailbox. An organization can grant one permission without granting the other, and its mail system enforces the distinction.

In Outlook’s object model, SentOnBehalfOfName sets the name or address used for the delegated sender identity. It does not create a mailbox account, grant Send As permission, or bypass Exchange or another provider’s access controls. For example, a macro might set mail.SentOnBehalfOfName = "team@example.com" on a message, but the message will still depend on the user’s existing mailbox permissions and the organization’s configuration. Check the result in a draft and ask the mail administrator if the sender is rejected or shown differently than expected.

If the shared mailbox is configured as its own account in the profile, selecting it through SendUsingAccount may be possible. If it is only opened as an additional mailbox, it may not appear in Session.Accounts. The correct method therefore depends on the Outlook profile and tenant configuration, not just on whether the mailbox is visible in the folder list.

Steps to verify before sending automatically

  1. Open classic Outlook and confirm that the intended account or mailbox is available in the profile.
  2. Check the exact sender address, including its domain. An account’s SMTP address is not always the same as its display name.
  3. Confirm with the mail administrator that you have permission to send as, or on behalf of, that mailbox.
  4. Run the macro with .Display and inspect the From field, recipients, subject, and message body.
  5. Send a test to an address you control and inspect the received message’s sender details and any reply behavior.
  6. Only then consider unattended sending, and add appropriate error handling and logging for the workbook’s real workflow.

These checks matter because the sender shown in a draft is not proof that the mail server will accept that sender. A test message confirms the end-to-end behavior, including server policy and how recipients see the message.

Common problems and what they mean

  • The requested address is not found: It may be an alias or an additional mailbox rather than an account in the profile. Inspect the configured accounts and ask the administrator which sending method is supported.
  • The message goes out from the default account: The account assignment may be missing, performed too late, or pointed at the wrong account. Set SendUsingAccount before displaying or sending the item, and verify the selected account’s SMTP address.
  • Outlook rejects the message: The user may not have the necessary Send As or Send on Behalf permission, or a policy may restrict automated or external mail. The VBA property cannot override those controls.
  • The recipient sees “on behalf of”: That is consistent with delegated sending rather than a true Send As identity. Ask the administrator whether Send As permission is available if the message should appear directly from the mailbox.
  • The macro cannot create or send an Outlook message: Check that classic Outlook is installed, configured, and available to the Windows user running the macro. Also review macro policy and any Outlook programmatic-access warning or organizational restriction.

Do not try to solve a permission error by changing only the visible From text. Email systems use authentication and authorization checks; making a message claim an address you are not allowed to use can lead to rejection, rewriting, or suspicious-message handling.

Compatibility and safety considerations

This guidance is for classic Outlook for Windows, which exposes the Outlook object model used by VBA automation. The new Outlook for Windows does not support VBA macros or the same COM automation model, so this code is not a solution for that app. Outlook for Mac also does not provide the same Windows Outlook VBA automation interface. If you use Excel on Mac or a browser-based mail client, the Windows example is not directly applicable.

Macros can send real messages, and Excel’s Undo command cannot reverse a message sent through Outlook. Save a copy of the workbook before running or changing a macro, as well as keeping a backup of any important source data. Start with .Display, use a test recipient, and avoid running code from an untrusted workbook.

Macro availability is controlled by Office security settings and may also be restricted by an organization’s policy. Do not enable all macros globally just to run one script. Use an approved, trusted workflow and ask your administrator if macro execution or Outlook automation is blocked. Some environments may also apply programmatic-access protections to automated sending.

Alternatives when Outlook VBA is not suitable

If the task is a one-off, composing the message in Outlook and choosing the From address manually may be simpler and easier to verify. For a repeatable business process, Microsoft Power Automate or an application using Microsoft Graph may be more appropriate, particularly where the organization needs centrally managed permissions, authentication, and logging. Availability and setup depend on the organization’s Microsoft 365 plan and policies.

These alternatives still require authorization to use the sender mailbox. They are not ways to evade mail-server rules. Choose based on whether the task is a local desktop workflow, a shared process, or an application that must send reliably without a person keeping Outlook open.

Frequently Asked Questions

Can VBA send an Outlook email from another account?
Yes, if the account is available in the Outlook profile. Find the matching account in Session.Accounts and assign it to the message’s SendUsingAccount property before sending.

Can I send from an address that is not in Outlook’s account list?
Not reliably by selecting an Outlook account. It may be an alias or delegated mailbox, which needs a supported mailbox configuration and the appropriate permissions. Ask your email administrator how that address is enabled for sending.

Does VBA let me send from a shared mailbox without permission?
No. VBA can set a sender property, but the mail service checks authorization. Request Send As or Send on Behalf access through your organization’s normal process.

Why does the recipient see “on behalf of”?
The message is being sent with delegated identity rather than appearing as a direct Send As message. The permission granted and mailbox configuration determine how the sender is displayed.

Will this macro work in the new Outlook?
No. The example relies on classic Outlook for Windows and its object model. New Outlook does not support this VBA automation approach; use an approved alternative such as a suitable Power Automate flow or Microsoft Graph application.

Related

Try it: the Column Letter to Number: aA is 27, XFD is 16,384. Converts both ways.

More in VBA & macros

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.