How to send email to multiple recipients through excel vba via Outlook/Gmail

Shabp

New Member
Joined
Mar 11, 2015
Messages
49
Hi All,

I am trying to automate task list by setting Send reminder if task is pending by using the below code:
For Outlook:

Sub SendReminderMail()
Dim OutLookApp As Object
Dim OutLookMailItem As Object
Dim iCounter As Integer
Dim MailDest As String


Set OutLookApp = CreateObject("Outlook.application")
Set OutLookMailItem = OutLookApp.CreateItem(0)


With OutLookMailItem
MailDest = ""
For iCounter = 1 To WorksheetFunction.CountA(Columns(10))
If MailDest = "" And Cells(iCounter, 10).Offset(0, -1) = "Send Reminder" Then
MailDest = Cells(iCounter, 10).Value
ElseIf MailDest <> "" And Cells(iCounter, 10).Offset(0, -1) = "Send Reminder" Then
MailDest = MailDest & ";" & Cells(iCounter, 10).Value
End If
Next iCounter


.To = MailDest
.Subject = "FYI"
.Body = "Reminder: Your task is due."
.Send
End With


Set OutLookMailItem = Nothing
Set OutLookApp = Nothing
End Sub

But, am getting an error like at least one user email should be mentioned and I want to set levels like if task is pending for 2 days - sendmail to level-1, 3 days - level-2 and more than 3 days level-3.

From Gmail - I don't know how to send for multiple recipients.

Please if anyone can help me on this I will very thankful to them.
Thanks in advance
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Forum statistics

Threads
1,214,385
Messages
6,119,209
Members
448,874
Latest member
b1step2far

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