?
Solved

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

Posted on 2004-09-21
16
Medium Priority
?
351 Views
Last Modified: 2008-01-09
Hi,

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 = "some@domain.com"
objMail.From = "some@domain.com"
objMail.Subject = "Information you requested"
objMail.Body = "Here is your password:"
objMail.Send 'Send off the email!

Thanks
0
Comment
Question by:mwidd101
  • 8
  • 3
  • 3
  • +1
15 Comments
 
LVL 31

Expert Comment

by:alorentz
ID: 12114575
Maybe you need CDOSYS instead....CDONTS isn;t installed on 2003 or XP
0
 
LVL 31

Accepted Solution

by:
alorentz earned 2000 total points
ID: 12114596
<%
Dim MyMail
Set MyMail = Server.CreateObject("CDO.Message")
MyMail.From = "justme@myaddress.com"
MyMail.To = "friend1@address1.com;friend2@address2.com"
MyMail.Cc = "friend3@address3.com;friend4@address4.com"
MyMail.Bcc = "friend5@address5.com;friend6@address6.com"
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;
MyMail.Fields.Update()
MyMail.Send()
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("http://schemas.microsoft.com/cdo/conf iguration/smtpserver") = "your smtp server"

Whether you use a authentication on the server
MyMail.Fields("http://schemas.microsoft.com/cdo/conf iguration/smtpauthenticate") = 1

Account Name
MyMail.Fields("http://schemas.microsoft.com/cdo/conf iguration/sendusername") = "account name"

Account Password
MyMail.Fields("http://schemas.microsoft.com/cdo/conf iguration/sendpassword") = "account password"

Port
MyMail.Fields("http://schemas.microsoft.com/cdo/conf iguration/smtpserverport") = 25

Pickup Directory
MyMail.Fields("http://schemas.microsoft.com/cdo/conf iguration/sendusing") = 2
'USER MUST HAVE CHANGE RIGHTS TO THE PICKUP DIRECTORY

Timeout
'MyMail.Fields("http://schemas.microsoft.com/cdo/con figuration/smtpserverpickupdirectory") = "c:\Inetpub\mailroot\Pickup"
MyMail.Fields("http://schemas.microsoft.com/cdo/conf 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 Fast-trak.net. All Rights Reserved

 
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 31

Expert Comment

by:alorentz
ID: 12114604
Whoops copied to much... :)
0
 
LVL 19

Expert Comment

by:peh803
ID: 12114607
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:
http://crt.doce.lsu.edu/CRT-HTML-Class/Lesson29a.html


Let me know if this helps!
peh803
0
 
LVL 10

Expert Comment

by:Clif
ID: 12114608
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 = "some@domain.com"
objMail.From = "some@domain.com"
objMail.Subject = "Information you requested"
objMail.TextBody = "Here is your password:"  '<--  Property has changed to TextBody!!!
objMail.Send 'Send off the email!
0
 
LVL 19

Expert Comment

by:peh803
ID: 12114631
ahh, there you go again, alorentz...giving 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.

regards,
peh803
0
 
LVL 19

Expert Comment

by:peh803
ID: 12114643
<reminder to self>Always refresh the page before I post</reminder to self>
0
 
LVL 31

Expert Comment

by:alorentz
ID: 12114656
Yes, I make that mistake frequently...good to follow-up with acknowledgement, as you do so well! :)
0
 
LVL 31

Expert Comment

by:alorentz
ID: 12132037
Why was that answer selected?  I gave the same solution ealier and provided much more detail if necessary?
0
 
LVL 10

Expert Comment

by:Clif
ID: 12132069
Good question.
0
 

Author Comment

by:mwidd101
ID: 12132084
I selected the last one as it was the more recent of the two.

Thanks for the help
0
 
LVL 31

Expert Comment

by:alorentz
ID: 12132112
>>more recent of the two.

What does that mean?
0
 
LVL 31

Expert Comment

by:alorentz
ID: 12132116
See here for details on Accepting answers:
http://www.experts-exchange.com/Community_Support/help.jsp#hi68
0
 
LVL 10

Expert Comment

by:Clif
ID: 12159037
ee_ai_construct,
I have no complaint if you feel the points should be transferred from me to alorentz.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question