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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error trying to send e-mail in VBSCRIPT..

Status
Not open for further replies.

MarkWilliamson

Programmer
Apr 1, 2002
34
US
I receive the following error message when trying to send an e-mail via VBScript ( code is below ). I assume there is a .DLL missing but I do not know which .DLL's to look for - any help would be appreciated.

Error :

ActiveX component can't create object:'Outlook.Application'

Code:

ToAddress"USER@X.NET" MessageSubject="TEXT"
MessageBody = "TEXT"
Set ol=CreateObject("CDO.Message")
Set ns=ol.getNamespace("MAPI")
Set newMail=ol.CreateItem(olMailItem)
newMail.subject = MesssageSubject
newMail.Body=MessageBody
newMail.Send

set ol=nothing
set ns=nothing
set NewMail=nothing
 
Thanks for your input..

I tried what you suggested but received the same error.. :(
 
MarkWilliamson,
silly question: is outlook installed & configured on the box you are running the script on?
did you try running the script with it open and closed?
if all else fails - look into blat. can be called from a command line via a .bat so it would be easy to dynamically create the .bat, run it then remove it via vbs.
regards,
longhair
 
Thanks for your advice !

LOL - yes MSOutlook is installed. I think it is just a matter of a DLL or COM object not being registered correctly.

If all else fails I will look into the blat option !

Thanks for your time !

Mark
 
MarkWilliamson,
if you think it's 'just a matter of a DLL or COM object not being registered correctly' have you tried running it on some other boxes?
another thing that just popped to mind is ms 'security'.
regards,
longhair
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top