Welcome to WebmasterWorld Guest from 126.96.36.199 , register , free tools , login , search , pro membership , help , library , announcements , recent posts , open posts Pubcon Platinum Sponsor 2014
CDO Emails Not working on Windows 2003 beckyc
I am using this code to send emails: Set myMail=CreateObject("CDO.Message") myMail.Subject= "Subject" myMail.From= "email@example.com"myMail.To= "firstname.lastname@example.org" myMail.HTMLBody ="Text here" myMail.Send 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]
If code is "as-posted" your "myMail.To" needs to be on a new line - see below.
myMail.From= "email@example.com" myMail.To= "firstname.lastname@example.org" 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] beckyc
My typing mistake in the message, sorry!
The ASP page code is formatted correctly.
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.
CDONTS is not supported by win2003 servers, you should use CDOSYS instead.
You can find tons of related articles
on the web [ google.com]
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..
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. carguy84
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") = "http://127.0.0.1"
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.Configuration.Fields.Update myMail.AutoGenerateTextBody = true