Getting CDONTS to work on Windows Server 2008 x64

Tags: IIS, SMTP, Classic ASP, ASP

A few questions come up in the forums @ about people moving Classic ASP applications that use CDONTS.  CDONTS was introduced in NT4 and was widely popular.  With the success of ASP applications ‘back in the day’, many used CDONTS to send emails from their application.   Windows Server 2008 x64 introduces a different challenge.  Here is the procedure I used to get CDONTS working.

1) Copy CDONTS.dll from another server to C:WindowsSysWOW64

2) Run regsvr32 c:windowsSysWOW64cdonts.dll

3) Grant the appropriate permissions on C:inetpubmailrootpickup (I granted USERS group Modify permissions).  You could get permission denied if the folder security isn’t adjusted.

4) I’m assuming you have installed the SMTP Service located in Server Manager > Features > SMTP Server option

5) Make sure when you when you install the SMTP service, you enable Relay for localhost > Administrative Tools > Internet Information Services (IIS6) > SMTP Virtual Server > Right click, Properties > Access Tab > Relay button > Add in the option.   Also enable logging for additional troubleshooting. 

‘Enable logging

‘Ensure logging will work on x64

6) Test using code listed below.

Here is the code to run CDONTS webpage.

    Dim strBody
    Dim CDONTSMail
    Set CDONTSMail = CreateObject(“CDONTS.NewMail”)
    CDONTSMail.From= “[email protected]
    CDONTSMail.To= “[email protected]
    CDONTSMail.Subject=”This is a Test email”
    strBody = “Thank you for order from” & vbCrLf
    CDONTSMail.Body= strBody
    set CDONTSMail=nothing

I recommend you use CDOSYS instead of CDONTS, however if you are trying to migrate from NT4, 2000/2003 and don’t want to make code changes, hope this helps. 

PS:I tested this using Network Service as the application pool user, a custom application pool user, IUSR (default anonymous authentication module user) and the Anonymous Authentication module inherit the application pool user as network service and a custom user.  If you are having permissions issues, enable auditing and use process monitor.  

Here is a article that can help with auditing.