Welcome to WebmasterWorld Guest from

Forum Moderators: ocean10000

Message Too Old, No Replies

CDO Emails

Not working on Windows 2003

2:23 pm on Apr 25, 2005 (gmt 0)

10+ Year Member

I am using this code to send emails:

Set myMail=CreateObject("CDO.Message")
myMail.Subject= "Subject"
myMail.From= "emailaddress@example.com"myMail.To= "myemail@example.com"
myMail.HTMLBody ="Text here"
set myMail = nothing

The from email address has been setup on the mail server. I do not get an error message but I also never receive the email! This code works fine on Win2k as I have other sites using it.

Any ideas what is happening?

[edited by: Xoc at 7:12 am (utc) on April 26, 2005]
[edit reason] Use example.com for examples [/edit]

2:39 pm on Apr 25, 2005 (gmt 0)

10+ Year Member

If code is "as-posted" your "myMail.To" needs to be on a new line - see below.

myMail.Subject= "Subject"
myMail.From= "emailaddress@example.com"
myMail.To= "myemail@example.com"
myMail.HTMLBody ="Text here"

Let's hope it's that simple.

[edited by: Xoc at 7:12 am (utc) on April 26, 2005]
[edit reason] Use example.com for examples [/edit]

2:50 pm on Apr 25, 2005 (gmt 0)

10+ Year Member

My typing mistake in the message, sorry!

The ASP page code is formatted correctly.

7:57 pm on Apr 26, 2005 (gmt 0)

10+ Year Member

Check the folders for the SMTP service. ASP is working correctly if you're not seeing errors.

Look at C:\inetpub\mailroot

Check "Badmail", "Pickup" and "Queue"

Let us know if you see files in any of the above folders *right after* re-loading your test page.

My guess is that we're looking at an SMTP server problem - service not running, a port conflict (if Exchange is also running on the server) or DNS would be some of the possible causes.

6:36 am on Apr 27, 2005 (gmt 0)

10+ Year Member

CDONTS is not supported by win2003 servers, you should use CDOSYS instead.

You can find tons of related articles on the web [google.com]

Good luck.


P.S.: I have used CDONTS for years, and when my host changed their servers to win2003, it took me many days to recognize, that my old asp codes didn't work anymore (there were no error messages as with you), and it was a pain to change all the good old working codes accordingly..

2:02 pm on Apr 27, 2005 (gmt 0)

10+ Year Member

Ah - If this is a Win2003 server, CDONTS is not installed by default. However, if you copy the cdonts.dll from the System directory of a Windows 2000 server into the System directory of the Windows 2003 server, you're up and running.
4:22 pm on Apr 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Hi, she's using CDOSYS no CDONTS.

Make sure SMTP is turned on(or even installed) on the server. Also, use On Error Goto 0 in your script and see if it throws any errors.

I also found that I had to add the following lines in 2003 to get it to work correctly:

myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = ""
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
myMail.AutoGenerateTextBody = true