Knowledgebase: Dedicated Server
I get an error 'Server.CreateObject Failed' when I try to use CDONTs. What can I do?
Posted by Phil (Netcetera) on 16 March 2008 02:20 PM

CDONTs is no longer supported on Windows 2003 server.  Microsoft introduced CDO back several years ago to replace CDONTs.

You will need to convert your code to use CDO. 

Sample code for CDO can be found below:

<%

set objMessage = createobject("cdo.message")
set objConfig = createobject("cdo.configuration")

' Setting the SMTP Server
Set Flds = objConfig.Fields
Flds.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.netcetera.co.uk"
Flds.update


Set objMessage.Configuration = objConfig
objMessage.To = "you@YourHostedDomainName.com"
objMessage.From = "someone@somewhere.com"
objMessage.Subject = "This is a sample email sent using CDO"
objMessage.TextBody = "Congratulation" & VbCrLf & "If you receive this is, your mail component works"
objMessage.fields.update
objMessage.Send

Response.write "Mail sent..."

set objMessage = nothing
set objConfig = nothing

%>

(991 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments: