Excel VBA Macro: Send Email from a Specific Account (in Outlook)

preview_player
Показать описание
Excel VBA Macro: Send Email from a Specific Account (in Outlook). In this video, we go over how to send an email from a different address. The code that we write allows the users to easily send emails from another address using "SentOnBehalfOfName". We also briefly go over how to create a dropdown list and insert the current date in a string.

#ExcelVBA #ExcelMacro
Рекомендации по теме
Комментарии
Автор

Thanks Gregg, this really helped me out a lot when automating e-Mails at work!

skiff
Автор

Excellent contribution, you really helped me with this code!!!

leopoldoleonel
Автор

Thanks Greg, just what I needed :) Thanks for sharing

mikevanwieringen
Автор

Thank you thank you thank you! You just saved me a ton of time!

Nova
Автор

Thanks buddy, this just helped me, nice and clear instructions. 👍

freezendog
Автор

Hi gregg, great video... is it possible to use the .SentOnBehalfOfMe function on Word mail merge?

jorgettesantos
Автор

Thanks for the video! I have an issue though. I am trying to send emails from a shared mailbox that I have access/rights to but Outlook crashes when I generate the email. It works perfectly fine with me deleting the SentOnBehalfOfName :/ Are you able to advise please?

agatasiwak
Автор

I have managed to create the vba code. There are 1200 rows, however for each row, there is a prompt in outlook to allow/deny sending the mails each time, defeating the purpose of automation

debayanroy
Автор

Somwhow, even afterctrying all this, I am still struggling to send the emails from my group email configured to the same outlook as the personal. I am missing something, i am not sure what

riteshblackbelt
Автор

how can you create spaces or tabs between word and lines in the HTML body ?

eduardosavinon
Автор

How can you exclude an outlook account from sending an email. The spreadsheet we have auto sends an email and saves the excel spreadsheet when you close it. It sends the emails to the bosses who then review the spreadsheet. However, when they close the spreadsheet, it sends another email to them. How can we remove their email addresses (outlook) from being able to send?

brianhobbs
Автор

When I send on be half another account, the sent item appears on my account. How can I solve this?

Moodlex
Автор

From address is not getting changed, pls assist

mailsuren
Автор

Hi how to send automatically when we click on run. When I run getting an error as run time error 287

akexcelinstitute
Автор

Hi Gregg, fantastic videos!!!
I´m new on VBA. I have been able to send 2 ranges to a email, one static and the another one dinamic as you can see in your code below
I would like to add the option of send an email from a different address
But it doesn´t work
any recommendation

Kind regards





Set OutApp =
Set OutMail = OutApp.CreateItem(0)

Set rg1 = Sheets("BLABLABLA").Range(Cells(1, 1), Cells(1, 9))

Set rg2 = Selection

str1 = "<BODY style = & _
"Hola buenos días, <p> BLABLABLABLA. <p>

str2 = "<br>Saludos, <br>Javi"

On Error Resume Next
With OutMail

.To = ""
.CC = ""
.BCC = ""
.Subject = "BLABLABLA "
.Display
.HTMLBody = str1 & str2 & RangetoHTML(rg1) & RangetoHTML(rg2) & .HTMLBody

End With
On Error GoTo 0

Set OutMail = Nothing
Set OutApp = Nothing

End Sub

javierromerolopez