muhleebbin
Active Member
- Joined
- Sep 30, 2017
- Messages
- 252
- Office Version
- 365
- 2019
- 2016
- 2013
- 2010
- Platform
- Windows
- MacOS
- Mobile
- Web
Hi Everyone,
I found this thread regarding this solution however was wondering if it could be applied to the code that I currently have:
I prefer this code as it could be modified to add fields to personalize the email, though it seems the mail_body_message overrides the signature in the other solution.
Any assistance would be greatly appreciated!
I found this thread regarding this solution however was wondering if it could be applied to the code that I currently have:
VBA Code:
Sub SendEmail(what_address As String, subject_line As String, mail_body As String)
'
' SendEmail Macro
'
Dim olApp As Outlook.Application
Set olApp = CreateObject("Outlook.Application")
Dim olMail As Outlook.MailItem
Set olMail = olApp.CreateItem(olmailitem)
olMail.Display
olMail.To = what_address
olMail.Subject = subject_line
olMail.HTMLBody = mail_body
olMail.Send
End Sub
Sub SendMassEmail()
row_number = Sheet4.Range("L2")
Do
DoEvents
row_number = row_number + 1
Dim mail_body_message As String
Dim full_name As String
Dim location_name As String
mail_body_message = Sheet4.Range("D2")
full_name = Sheet4.Range("A" & row_number)
mail_body_message = Replace(mail_body_message, "replace_name_here", full_name)
Call SendEmail(Sheet4.Range("B" & row_number), "Email Subject", mail_body_message)
Loop Until row_number = Sheet4.Range("L3")
End Sub
I prefer this code as it could be modified to add fields to personalize the email, though it seems the mail_body_message overrides the signature in the other solution.
Any assistance would be greatly appreciated!