Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why cdonts.newmail failed after upgrade

Status
Not open for further replies.

rgao

Technical User
Feb 1, 2002
38
CA
Hi,friends
I post this message in ASP forum, no reply,so I post it here to try my luck.
I have ASP page using CDONTS.NEWMAIL to send email.It works well in IIS5 in Windows 2000.recently I upgrade my system to Windows XP,IIS5.1 and install ASP.net.when I run this ASP page,I got error message"activeX component can not create cdonts.newmail object". I checked my system,found that the Cdonts.dll doesn't exist.so i copy this file from windows2000.but it still failed.
Could anyone tell me why cdonts.newmail doesn't work in iis5.1.(I check msdn web site, but no hint),is it replaced by another object?.Thanks for any suggestion.
 
Yes... there's a new way to send mail in asp.net.

The objects reside in the System.Web.Mail namespace, and they are:

mailMessage
and
smtpMail

You can use the object browser to browse around and find all the methods and properties for each, but here's a quick and dirty example:



Imports System.Web.Mail

dim newMsg as new MailMessage()
newMsg.body = "here's your body"
newMsg.subject = "here's your subject"
newMsg.to = "someone@somewhere.com"
newMsg.from = "me@mySite.com"

smtpMail.send(newMsg)


So notice it takes two objects now to work with mail. smtpMail object also has a smtpServer property that you can use to point the mail through some other server, if you should need that. Otherwise, it will try to send mail through your smtp service on the server where the script is, and will fail if that service isn't started and configured properly.

:)
paul
penny1.gif
penny1.gif
 
Hi,Paul

I'm glad to hear from you, thank you for your suggestion.but I still have a question for you:
how can i use classic asp(not asp.net) to send email through IIS5.1? does these code work with classic ASP?
(Imports System.Web.Mail
........
smtpMail.send(newMsg)

thanks in advance
rgao
 
No, the IMPORTS statement is not valid in classic ASP....

However, if CDONTS is not working, then I would suggest going into

Control Panel --> Add/Remove Programs --> Windows Components

and add the SMTP service. It should install and properly configure CDONTS for you, and then you can use the syntax for classic asp

set mailObj = server.createObject("CDONTS.NewMail")

etc....

:)
penny1.gif
penny1.gif
 
Hi,Paul
Thanks for your reply.Actually I already installed smtp service in my computer, and this service in running status.but as I mentioned in my first message there is no cdonts.dll in winXP system,I copy it from win2K to winXP,but still saying"can not creat "cdonts.mewmail" object.
Right now the classic ASP can't send out email in WINXP IIS5.1,Any thoughts?
I'm looking forward to hearing from you.
thanks
Rgao
 
HI

Did you register the cdnots.dll in WinXp

register32 cdnots32.dll or something like that

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top