воскресенье, 20 июля 2014 г.

Send mail by Outlook with VBS


Send mail by Outlook with VBS

Create this file.vbs with next code:


Dim ToAddress
Dim FromAddress
Dim MessageSubject
Dim MyTime
Dim MessageBody
Dim MessageAttachment
Dim ol, ns, newMail
MyTime = Now

ToAddress = "Dmitry@example.org"
MessageSubject = "It works!."
MessageBody = "Good job on that script." 
' MessageAttachment = some attachment
Set ol = WScript.CreateObject("Outlook.Application")
Set ns = ol.getNamespace("MAPI")
Set newMail = ol.CreateItem(olMailItem)
newMail.CC = ToAddress
newMail.Subject = MessageSubject
newMail.Body = MessageBody & vbCrLf & MyTime
newMail.RecipIents.Add(ToAddress)
' newMail.Attachments.Add(MessageAttachment)
newMail.Send




Комментариев нет:

Отправить комментарий

Постоянные читатели

Популярные сообщения