CDONTS to CDOSYS

I am moving my web files to a new (Win2003) server which is seperate from the box that holds my email server. I am having trouble with the 'Contact Us' kinds of pages that used to use CDONTS but now use CDOSYS. I believe the problem is the sendusing deal but it may be a port issue. Here is my code:

Dim iMail, iConf, Flds
Dim sMsg, sName, sEmail, sSubject

sName = Request.Form.Item("name")
sEmail = Request.Form.Item("email")
sSubject = Request.Form.Item("subject")
sMsg = "From: " & sName & vbCrLf
sMsg = sMsg & "Email: " & sEmail & vbCrLf & vbCrLf
sMsg = sMsg & Request.Form.Item("message")

Set iMail = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
Flds "http://schemas.microsoft.com/cdo/configuration/sendusing") = 3
Flds.Update

Set iMail.Configuration = iConf
With iMail
.To = "[email protected]"
.From = sEmail
.Subject = sSubject
.TextBody = sMsg
.Send
End With

Set iMail = Nothing
Set iConf = Nothing
Set Flds = Nothing


I am open to suggestions. Thanks in advance!!!Do you get an error? or do you just not get an email?

IIS 6.0 servers don't always have SMTP enabled by default - sometimes you have to go into the Services on the server and start that service and set it up to start automatically on boot.

P.S. Can you try to post any questions strickly related to ASP/.NET in this forum........my fingers get tired of moving threads (I get enough exercise with the spammers :P) ;)I got it figured out and yes I will try to use this forum-sorry!!!! You people work pretty hard. You don't need any extra work from me!
 
Back
Top