Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2004-09-21
16
333 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
16 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

Expert Comment

by:alorentz
ID: 12114585
0
 
LVL 31

Accepted Solution

by:
alorentz earned 500 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Suggested Solutions

Title # Comments Views Activity
I am getting ASP error  xmlParseEntityRef: no name. Anyone can help ? 1 71
Select distinct 25 115
Using Classic ASP inside HTML pages 2 62
edit .asp files 5 30
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 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