Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable to send Email with outlook closed

Status
Not open for further replies.

mail8mz

Programmer
Jan 30, 2014
1
CA
Hello,

I am using the folowing vbscript to send email. It works fine only when the outlook is open in the machine, the operation is aborted when the outlook is closed. Any suggestion on it? I thought the script should start outlook by itself if it is not running.

Set MyApp = CreateObject("Outlook.Application")
Set MyItem = MyApp.CreateItem(0) 'olMailItem
With MyItem
.To = "a@b.c"
.Subject = "Subject"
.ReadReceiptRequested = False
.HTMLBody = "Message<BR>Line 2"
End With
MyItem.Send


Thanks for your help!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top