Solved

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

Posted on 2004-09-21
16
325 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
migrate from classic ASP to C# .NET 5 68
Dreamweaver server behavior gone 6 108
PDF Embed pdfobject.js local path problem regular ASP 2 117
Select distinct 25 82
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 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…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

914 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

15 Experts available now in Live!

Get 1:1 Help Now