Sending e-mail with CDO

I'm having a little trouble with my code.

It gives me this error message:

ADODB.Fields error '800a0bb9'

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

/LABS/Lab8/example1.asp, line 8

Line 8 is this: .Item(cdoSendUsingMethod)=2

Can someone please help me?

This is my whole code:

'set the CDO object
Set cdoConfig=CreateObject("CDO.Configuration")

'apply data to CDO properties, port number and server name
With cdoConfig.Fields
      .Item(cdoSMTPServer)= ""
End With

'begin the message section
Set cdoMessage=CreateObject("CDO.Message")

'add data to e-mail properties
With cdoMessage
      Set .Configuration=cdoConfig
      .Subject="WANNA SEE SOMETHING....??"
      .TextBody="Haha.... Fooled You!!!"
      .AddAttachment "c:\test.txt"
End With

'release objects and memory
Set cdoMessage=Nothing
Set cdoConfig=Nothing
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I suspect that the problem is because you need to enclose the Item arguments in double quotes:


Have a look here ( if that doesn't sort it.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Actually the problem lies with the fact that you are using late binding 'CreateObject("CDO.Message")' and are then using CDO constants as Item arguments.

Use the method contained within the link I gave in my previous post. I've used this method successfully.

Cherukuri30Service EngineerCommented:
Guess Metadata is missing try adding the below code in your page

NAME="CDO for Windows 2000 Library"

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.