Click to See Complete Forum and Search --> : CDO ERROR ADODB.Fields error '800a0bb9'


shritesh
11-16-2005, 07:16 AM
Hi All,

I am a web developer having following problem while executing one of my mailing script.[CDO.Message]

while executing the script i get this error.

The script is as:
********************************
SUB sendmail( fromWho, toWho, Subject, Body )
Dim objCDO
Dim iConf
Dim Flds
Const cdoSendUsingPort = 25
Set objCDO = Server.CreateObject("CDO.Message")
Set iConf = Server.CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
With Flds
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "mail-fwd"
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPconnectiontimeout) = 100
.Update
End With
Set objCDO.Configuration = iConf
objCDO.From = fromWho
objCDO.To = toWho
objCDO.Subject = Subject
objCDO.TextBody = Body
objCDO.Send

END SUB
************************************
after executing the above script i get the following error

************************************

ADODB.Fields error '800a0bb9'

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

/domail.asp, line 11
************************************

Please guide me.

Thank you
Shritesh

Giskard
11-16-2005, 10:51 AM
Are you importing the CDO library? (<!--METADATA TYPE="TypeLib" FILE="C:\WINNT\system32\cdosys.dll" --> )

if not then the constants you are using (cdoSendUsingMethod, cdoSMTPServer, cdoSMTPServerPort, cdoSMTPconnectiontimeout) will have no values and would be causing the problem.

kiathau
11-16-2005, 11:02 AM
With Flds
.Item(cdoSendUsingMethod) = cdoSendUsingPort <== Same Value, change to 2
.Item(cdoSMTPServer) = "mail-fwd"
.Item(cdoSMTPServerPort) = 25 <== Same Value
.Item(cdoSMTPconnectiontimeout) = 100
.Update

For normal case, where default configuration is good enough, we do not need to set the configuration.

Read the following,

http://www.w3schools.com/asp/asp_send_email.asp

http://www.brainjar.com/asp/formmail/default.asp

Kiat Hau,
http://webidiot.blogspot.com, Let's build your web site

shritesh
11-17-2005, 02:50 AM
Thanks a lot. you solved my problem.

Again thank you for your replies,