Can we change FROM email address while sending Outlook emails using vba

Gautham A

Board Regular
Joined
May 25, 2020
Messages
107
Office Version
  1. 2016
Platform
  1. Windows
Hi Team,
In my workplace, I have two mailboxes. One is my individual email I'd. Other is my team mailbox.(say TEAM A). While sending emails through Outlook in the from section, I will get option to put my team mail address. Now I'm writing a code to send email through Excel VBA. The problem here is the from section takes my individual mail address. I want my team mail I'd in FROM section. Is there a way to change it through Excel VBA?
 
Hola, finalmente encontraste una solución? Tengo exactamente el mismo problema.
¿Tienes acceso desde tu equipo, además de tu cuenta fija, a la cuenta desde la cuál pretendes enviar tus correos? Para ejemplificar y pronta referencia, solicita a quien se deba de tu Mesa de ayuda o área de sistemas que te de acceso a otra cuenta y tengas así dos en tu equipo para que realices tus pruebas y evites el suponer. Comenta.
 
Upvote 0

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Hi, finally did you find a solution? I have exactly the same problem.
I got this to work using:

With OutMail
.SentOnBehalfOfName = "user@domain.TLD"
.To = sEmailTo
.BCC = ""
.subject = sEmailSubject
.Attachments.Add Fname, 1, 0
.HTMLBody = msg1
.SendUsingAccount = oAccount
.Display

End With
 
Upvote 0
Try this:

For a = 1 To OutApp.Session.Accounts.Count
If UCase(OutApp.Session.Accounts.Item(2).DisplayName) = UCase("e-mail U want use") Then
Set sd = OutApp.Session.Accounts.Item(2)
Set ad = sd.CurrentUser.AddressEntry
Next
...
Set OutMail = OutApp.CreateItem(0)
Set OutMail.Sender = ad
...
 
Upvote 0

Forum statistics

Threads
1,221,848
Messages
6,162,419
Members
451,765
Latest member
craigvan888

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top