CDONTS - Server object, ASP 0177 (0x800401F3) error


I'm trying to send an email using cdonts but I keep getting the following error can anyone shed some light on why i'm getting it?

Error Type:
Server object, ASP 0177 (0x800401F3)
Invalid class string
/new/account_remind.asp, line 78

Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)

Here's the code i've been using:
Dim objMail
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.To = ""
objMail.From = ""
objMail.Subject = "Information you requested"
objMail.Body = "Here is your password:"
objMail.Send 'Send off the email!

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

Maybe you need CDOSYS instead....CDONTS isn;t installed on 2003 or XP
Dim MyMail
Set MyMail = Server.CreateObject("CDO.Message")
MyMail.From = ""
MyMail.To = ";"
MyMail.Cc = ";"
MyMail.Bcc = ";"
MyMail.Subject = "Sending Mail via CDOSYS for Windows 2000/XP"
MyMail.TextBody = "Sending email with CDOSYS Message " &_
"objects is easy! Try it!"
MyMail.AddAttachment "c:\path\smiley.gif"
MyMail.Fields("urn:schemas:httpmail:importance").Value = 2;
Set MyMail = Nothing

Note the two main differences between CDONTS and CDOSYS.

Set MyMail = Server.CreateObject("CDO.Message")

MyMail.Fields("urn:schemas:httpmail:importance").Value = 2;

There are many other schemas that can be used with the CDOSYS object. Here are a few.

Out going SMTP server
MyMail.Fields(" iguration/smtpserver") = "your smtp server"

Whether you use a authentication on the server
MyMail.Fields(" iguration/smtpauthenticate") = 1

Account Name
MyMail.Fields(" iguration/sendusername") = "account name"

Account Password
MyMail.Fields(" iguration/sendpassword") = "account password"

MyMail.Fields(" iguration/smtpserverport") = 25

Pickup Directory
MyMail.Fields(" iguration/sendusing") = 2

'MyMail.Fields(" figuration/smtpserverpickupdirectory") = "c:\Inetpub\mailroot\Pickup"
MyMail.Fields(" iguration/smtpconnectiontimeout") = 60

Now that you know all about the CDOSYS NewMail object, let's look at how to put this all together in a working user interface.

You can see an example of an CDOSYS email submission form on the next page.

CDOSYS with ASP Tutorial Continued

Back to top of page

about us | contact us | support | design | training | custom scripting | site map | privacy policy | useful links | tutorials | testimonials | uk web hosting | asp web hosting

Copyright © 2003 All Rights Reserved


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
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

Whoops copied to much... :)
Are you running windows XP?  XP does not come with cdonts.dll (which the compiler needs in order to process the code).

download / registration instructions for the dll here:

Let me know if this helps!
What server are you using?

It may be better to use CDOSYS.  CDONTS is being deprecated.

Do this instead:
Dim objMail
Set objMail = Server.CreateObject("CDO.Message")  '<-- Object name has changed!!!
objMail.To = ""
objMail.From = ""
objMail.Subject = "Information you requested"
objMail.TextBody = "Here is your password:"  '<--  Property has changed to TextBody!!!
objMail.Send 'Send off the email!
ahh, there you go again, the "right" answer!  Wacky you!

@mwidd101 -- I would recommend that you follow alorentz's advice on this one rather than using the old cdonts object that I've pointed you to.

<reminder to self>Always refresh the page before I post</reminder to self>
Yes, I make that mistake frequently...good to follow-up with acknowledgement, as you do so well! :)
Why was that answer selected?  I gave the same solution ealier and provided much more detail if necessary?
Good question.
mwidd101Author Commented:
I selected the last one as it was the more recent of the two.

Thanks for the help
>>more recent of the two.

What does that mean?
See here for details on Accepting answers:
I have no complaint if you feel the points should be transferred from me to alorentz.
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.