Getting CDONTS to work on Windows Server 2008 x64

Tags: IIS, SMTP, Classic ASP, ASP

A few questions come up in the forums @ http://forums.iis.net 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 127.0.0.1 in the option.   Also enable logging for additional troubleshooting. 

‘Enable logging
http://weblogs.asp.net/steveschofield/archive/2007/03/25/want-help-with-iis-smtp-service-please-enable-logging.aspx

‘Ensure logging will work on x64
http://weblogs.asp.net/steveschofield/archive/2008/02/29/windows-server-2008-smtp-service-logging-tip.aspx

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 www.iislogs.com.” & vbCrLf
    CDONTSMail.Body= strBody
    CDONTSMail.Send
    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.  http://weblogs.asp.net/steveschofield/archive/2008/03/07/detecting-permission-issues-using-auditing-and-process-monitor.aspx

Cheers,

Steve