Question : Send mail with classic asp on IIS7 (CDO.Message)

I have moved a classic asp (3.0) site from Windows 2003 to Windows 2008 server. Now, the mailforms don't work. I have installed SMTP server on the Windows 2008 server.

After hours of research and testing I have tried "everything". But still no luck. The webserver just give me this Errormessage: "500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed."

In IIS I have changed the ASP Debugging Properties: Send Error To Browser = True. I have also changed "Show friendy Error Messages to False in Internet Explorer.

The mail script I use is attached. Does anyone have a clue why it don't work on my Windows 2008 Server?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
Set cdoMail = CreateObject("CDO.Message")
Set cdoConfig = CreateObject("CDO.Configuration")
Set Flds = cdoConfig.Fields

With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'cdoSendUsingPort
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Update
End With

With cdoMessage
Set .Configuration = cdoConfig
.To = "[email protected]"
.From = "[email protected]"
.Subject = "test"
.TextBody = "Here is the message"
.Send
End With

Set cdoMessage = Nothing
Set cdoConfig = Nothing
Set Flds = Nothing

Answer : Send mail with classic asp on IIS7 (CDO.Message)

Actually CDO, as you are using it, should work.  It was CDONTS that was for Windows 2000 and earlier and is now deprecated.

Are you sure SMTP works?  Is it set up on this same machine or another?  Can you test it to make sure that isn't the problem.  The code looks good.

The other possibility is it needs authentication or requires some parameter you are leaving out.  If it is working and was set up by another then can they provide you with a sample of working code or details for the connection and use?

bol
Random Solutions  
 
programming4us programming4us