homepage Welcome to WebmasterWorld Guest from 54.166.100.8
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library, Charter, Moderators: ocean10000

Microsoft IIS Web Server and ASP.NET Forum

    
CDO Emails
Not working on Windows 2003
beckyc




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

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"
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]

 

dotme




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

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]

beckyc




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

My typing mistake in the message, sorry!

The ASP page code is formatted correctly.

dotme




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

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.

yaelede




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

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.

yaelede

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..

dotme




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

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




msg:942370
 4:22 pm on Apr 27, 2005 (gmt 0)

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved