CDONTS on Windows 2003 Server

I've been working with CDONTS email messaging for quite a while on a Windows 2000 server that also had SQL 2000 installed on it.  This server was our Intranet server so it had IIS on it too.  I had a SQL stored procedure that sent the mail, and all worked perfectly.

Recently, we purchased 2 new servers to replace the old one.  We decided to load Windows 2003 and put the SQL databases on one server (HMCNTDOCSQL) and the web services (IIS on a different server -- HMCNTDOC1). The SMTP service is running on HMCNTDOC1,a nd I set it up with the correct name of our SMTP server.  As you can probably guess, it isn't working any more.  I'm using the same SQL stored procedure, and no emails.

Yesterday, I edited this code into my web page (.asp):

Dim MyBody
Dim MyCDONTSMail

Set MyCDONTSMail=CreateObject("CDONTS.NewMail")
MyCDONTSMail.From="somebody@nnnnn.com"
MyCDONTSMail.To="Betsy.Valanti@Halifax.org"
MyCDONTSMail.Subject="Test"
MyBody="I Hope This Works"
MyCDONTSMail.Body=MyBody
MYCDONTSMail.Send
set MyCDONTSMail=nothing

When I use this, I get the following error message:  

Microsoft VBScript runtime error '800a01ad'

ActiveX component can't create object: 'CDONTS.NewMail'

/ITChangeNotification/IT/Insert.asp, line 57


I think the code is correct, so I'm wondering if there is something I missed in setting up IIS.

Any suggestions?

BetsyVAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

fz2hqsCommented:
CDONTS was depreciated and you need to use CDO instead, it isn't a massive change here is a template

      Set objErrMail= Server.CreateObject("CDO.Message")
      With objErrMail
            .From = "From Address<from@domain.com>"
            .To = "recipient@domain.com"
            .Subject = "Subject Line"
            .HTMLBody = CStr("" & strBody)
            .Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
            .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "IP of smtp server"
            .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
            .Configuration.Fields.Update
            .Send
      End With
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
BetsyVAuthor Commented:
I think I'm closer, but still getting an error.  When I added the above code to my page, I get the following:

CDO.Message.1 error '8004020a'

The SMTP server name is required, and was not found in the configuration source.

I have the IP address of the smtp server, but do I also need a line for the server name?

Thanks !!
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

BetsyVAuthor Commented:
Thanks so much.  I found my error.  I had the IP of our smtp server, and should have put the name.  Once I fixed this, it worked great.

I really appreciate the help.
0
kmiller7Commented:
I need help converting a mail script from CDONTS to CDO script.  I know just enough to make other peoples code work but I am having trouble converting this code I already have to work properly.
Thank you for any Help!!


<%

Dim strSender
Dim strRecipientsName
Dim strRecipients
Dim strSubject
Dim strMessage

strRecipientsName = Request.Form("Name")
strRecipients = Request.Form("Email")
strSubject = "From: " & Request.Form("YName") & " Picture"
strMessage = "Hello " & Request.Form("Name") & vbCrLf & vbCrLf
strMessage = strMessage & Request.Form("Msg") & vbCrLf & vbCrLf
strMessage = strMessage & "You received this from : " & Request.Form("YName") & " " & Request.Form("YEmail")
strSender = Request.Form("YEmail")
%>
<%

            Set objNewMail = Server.CreateObject ("CDONTS.NewMail")
                objNewMail.cc = "email@address.com"
            objNewMail.BodyFormat = 1
            objNewMail.MailFormat = 0
            on error resume next '## Ignore Errors
            objNewMail.Send strSender, strRecipients, strSubject, strMessage
            If Err <> 0 Then
                  Err_Msg = Err_Msg & "<li>Your request was not sent due to the following error: " & Err.Description & "</li>"
            End if
            on error resume next '## Ignore Errors
Set objNewMail = Nothing
%>
0
fz2hqsCommented:
kmiller7 - Don't jump in other peoples threads, start one of your own
0
vbishopCommented:
Excellent bit of code fz2hqs!

The Internet Community Appreciates it!

The code worked perfectly the first time I tried it!

Best,

Vincil Bishop
http://peoplesinformation.com
0
varun_minhasCommented:
Hi, I'm new here but my question is on topic. I'm currently upgrading to server 2003 with exchange 2003 (fresh installation) and nothing as far as forms seems to want to work. As far as I remember with server 2000, all you had to do was change the appilcation pool under the website properties to "Low IIS processed" but with the new system I cannot seem to get forms to work. The error message I receive is as follows:
 
Server object error 'ASP 0177 : 800401f3'
Server.CreateObject Failed
/membership.asp, line 42
800401f3

On top of which my current server 2000 with exchange server 2000 seem to keep freezing. Virtually everyday or ever other day I have to come in and restart the machine. It just falls asleep and never gets back up. I've check all the power management settings, etc. They are highly unreliable and I need to get some stable machines working.
Please help.  
0
vbishopCommented:
varun_minhas -

More than happy to help.

Please start a new thread, then email me the link:

{{email address removed for member's protection --alimu/Page Editor IIS}}

Many times I have found that MS Servers behave better if they get their daily reboot.

The error appears as if you are trying to use an activex dll that is not registered.

Best,

Vincil Bishop
{{website address removed as per: http:/help.jsp#hi106 --alimu/Page Editor IIS}}
0
mrnmnewCommented:
or you could add CDONTS to windows 2003 :

To copy CDONTS to a computer running Windows Server 2003

On the source server, copy Cdonts.dll from the systemroot\system32 folder to a floppy disk.

On the target server, copy Cdonts.dll from the floppy disk to the folder systemroot\system32.

To register CDONTS, on the target server, in the Run dialog box, type cmd, and then click OK.

At the command prompt, change to the systemroot\system32 directory, and then type:

regsvr32 windir\system32\cdonts.dll

If the process is successful, the following message displays:

DllRegisterServer in cdonts.dll succeeded.

Click OK.
0
smilbanditCommented:
I could not get it to run using a cdonts.dll from a windows nt install.  I'm not sure where I got it but I had another cdonts.dll on my windows 2000 install that was bigger in file size (~400k) and that worked fine.  The version of the file I used is 6.0.3940.15 and said that it was from microsoft exchange.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft IIS Web Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.