954,546 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

A script to write an email with a problem!

Im developing an application console based in c++ , and needed a quick and easy way to script an outlook email. I found the below script to use which works great, but for one problem.
PROBLEM:

When the script is ran, outlook prompts me to let me know an application is useing itself and it could be a virus of some type and gives me three options. I need this to be fully automated without the prompts.. e.g script runs email gets sent nothing more! Can someone help me.. I dont know alot about scripting.

Dim theApp, theMailItem

Set theApp = WScript.CreateObject("Outlook.Application")
Set theNameSpace = theApp.GetNameSpace("MAPI")

Set theMailItem = theApp.CreateItem(0)

theMailItem.Recipients.Add "genGOTCHA@yahoo.com"
theMailItem.Subject = "TESTING EMAIL"
theMailItem.Body = "I GOSH I THINK IT WORKED"
theMailItem.Send
theNameSpace.Logoff

CodyOebel
Junior Poster in Training
94 posts since May 2007
Reputation Points: 8
Solved Threads: 3
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You