Author : Fortunato Estorgio Jr.
Date Submitted : 10/26/2007
Category : Internet
Compatibility : VB 6,Vbscript
This code has been accessed 4973 times.
Task : Send email with attachment with Microsoft Outlook 2007 & 2003!
Declarations
Code
On Error Resume Next
Function SendMail(Recipient, MailSubject, TextBody, FileAttachment)
Set Outlook = CreateObject("Outlook.Application")
Set OutlookMail = Outlook.CreateItem(0)
Set Attachment = OutlookMail.Attachments
OutlookMail.To = Recipient
OutlookMail.Subject = MailSubject
OutlookMail.Body = TextBody
Attachment.Add FileAttachment, 1, 1, "File Attachment"
'OutlookMail.Send
OutlookMail.Display
SendKeys "%{s}", True
End Function