Hi everyone. I have a problem with Attachments in script wich sends email. I use Outlook 2000, and my script looks like this:
Dim ToAddress
Dim FromAddress
Dim MessageSubject
Dim MessageBody
Dim MessageAttachment
Dim ol, ns, newMail
Dim dtmCurrentDate
dtmCurrentDate = Date
ToAddress = "myname@myhome.com"
MessageSubject = "Free disk space report: "
MessageBody = ""
MessageAttachment = "c:\DiskReport jtomazic " _ &dtmCurrentDate & ".txt"
Set ol = WScript.CreateObject("Outlook.Application")
Set ns = ol.getNamespace("MAPI")
Set newMail = ol.CreateItem(olMailItem)
newMail.Subject = MessageSubject
newMail.Body = MessageBody & vbCrLf
newMail.RecipIents.Add(ToAddress)
newMail.Attachments.Add(MessageAttachment)
newMail.Send
I know how to send 1 Attachment in this script, but i want to send 4 attachments. Any advice how to solve this problem?? Thx
Dim ToAddress
Dim FromAddress
Dim MessageSubject
Dim MessageBody
Dim MessageAttachment
Dim ol, ns, newMail
Dim dtmCurrentDate
dtmCurrentDate = Date
ToAddress = "myname@myhome.com"
MessageSubject = "Free disk space report: "
MessageBody = ""
MessageAttachment = "c:\DiskReport jtomazic " _ &dtmCurrentDate & ".txt"
Set ol = WScript.CreateObject("Outlook.Application")
Set ns = ol.getNamespace("MAPI")
Set newMail = ol.CreateItem(olMailItem)
newMail.Subject = MessageSubject
newMail.Body = MessageBody & vbCrLf
newMail.RecipIents.Add(ToAddress)
newMail.Attachments.Add(MessageAttachment)
newMail.Send
I know how to send 1 Attachment in this script, but i want to send 4 attachments. Any advice how to solve this problem?? Thx