Solved

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

Posted on 2004-09-21
16
323 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
 
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

707 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now