strToaddress = "Jayakrishna@sample.com;Jayakrishna2@sample.com"
strSubject = "Sample-Subject"
strBody = "Sample-Body"
strAttachPath = "C:\Dump\Sample.txt"
SendMailFromOutlook strToaddress,strSubject,strBody,strAttachPath
Function SendMailFromOutlook(strToaddress,strSubject,strBody,strAttachPath)
Dim objOut, Objmail
Set objOut = CreateObject("Outlook.Application")
Set Objmail = objOut.CreateItem(0)
With Objmail
.To = strToaddress
.Subject = strSubject
.Body = strBody
If strAttachPath <> "" Then
.Attachments.Add(strAttachPath)
End If
.Save
.Send
End With
'Clear the memory
Set objOut = Nothing
Set Objmail = Nothing
End Function
Note : Mail will be sent from your Local Configured Outlook.
Comments