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
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