Solved

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

Posted on 2004-09-21
16
337 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
[X]
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
  • 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

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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

729 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