Link to home
Start Free TrialLog in
Avatar of BetsyV
BetsyV

asked on

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?

ASKER CERTIFIED SOLUTION
Avatar of fz2hqs
fz2hqs

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BetsyV
BetsyV

ASKER

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 !!
Avatar of BetsyV

ASKER

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.
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
%>
kmiller7 - Don't jump in other peoples threads, start one of your own
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
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.  
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}}
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.
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.