Using CDONTS on Windows 2003

 The following error is returned when running CDONTS.NewMail on Windows 2003 (IIS 6)Invalid class string
‘ or
ActiveX component can’t create object: ‘CDONTS.NewMail’
‘ or
The "SendUsing" configuration value is invalid.


The problem is due to Microsoft’s change in the name and progID when the DLL is used
to send mail through CDO. 


Use the following Code: 
    sch = ""
    Set cdoConfig = Server.CreateObject("CDO.Configuration")
    cdoConfig.Fields.Item(sch & "sendusing") = 2
    cdoConfig.Fields.Item(sch & "smtpserver") =
    Set cdoMessage = Server.CreateObject("CDO.Message")
    Set cdoMessage.Configuration = cdoConfig
    cdoMessage.From = ""
    cdoMessage.To = ""
    cdoMessage.Subject = "Sample CDONTS NewMail"
    cdoMessage.TextBody = "This is a test for CDONTS message"
    Set cdoMessage = Nothing
    Set cdoConfig = Nothing

Content retrieved from:

Updated on November 11, 2019

Was this article helpful?

Related Articles

Need Support?
Can't find the answer you're looking for? Don't worry we're here to help!