Want to add multipul mail Id in To. List

nkashyap3

New Member
Joined
Jun 27, 2019
Messages
24
Office Version
  1. 2010
Platform
  1. Windows
Hi Friends,
I have prepare the code for Outlook office 365 window
My criteria is one of file is save in my system C:\Drive and this file attache in mail and send to the team member . My code is working if I send only one person, Not working on multiple mail Id , please help for resolve this Issue

Sub Mail_small_Text_Outlook()
'Working in Office 2000-2010
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Dim answer As Integer

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)



strbody = "Hi there" & vbNewLine & vbNewLine & _
"PFA"

On Error Resume Next
With OutMail
.To = "neetu123i@gmail.com"
.CC = ""
.BCC = ""
.Subject = "text file"
.Body = strbody
.Attachments.Add ("C:\CPF\201809_NO_Amnt.txt") 'ou can add a file like this
.Display
answer = MsgBox("Do you want to send an e-mail?", vbYesNo + vbQuestion, "Send Email")
'
If answer = vbYes Then
.Send
Else
Exit Sub
End If

End With
On Error GoTo 0

Set OutMail = Nothing
Set OutApp = Nothing



End Sub
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

Forum statistics

Threads
1,214,832
Messages
6,121,851
Members
449,051
Latest member
excelquestion515

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