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

Error in VB script

Status
Not open for further replies.

rene316

Programmer
Jan 14, 2002
81
US
Hello,

I am trying to write a VB Script to send out a text email, however when I execute the script I get this error...
-----------------------------------------------------------
Error: Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

Code: 800A0BB9

Source: ADODB.Fields
----------------------------------------------------------

Here is the code:

Dim iMsg
Dim iConf
Dim Flds
Set iMsg = CreateObject("CDO.Message")
Set iConf = iMsg.Configuration
Set Flds = iConf.Fields
Flds(cdoSendUsingMethod) = cdoSendUsingPort
Flds(cdoSMTPServer) = "localhost" 'set as appropriate
Flds(cdoSMTPServerPort) = 25 'set as appropriate
Flds.Update
Set Flds = Nothing
With iMsg
.To = "me@mycompany.com"
.From = "me@mycompany.com"
.CC = "me@mycompany.com"
.Subject = "Your lights are on, but no one is home"
.TextBody = "You left your lights on this morning."
.Fields.Update
.Send
End With
Set iMsg = Nothing


Anyone see where my problem is? Any help is much appreciated.

Thanks in advance.
Rene
 
You may want to post this in the VBScript forum:

forum329

But in the meantime, it looks like you are using several VB constants that would not be defined in VBScript, i.e. cdoSendUsingMethod, cdoSendUsingPort, etc.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top