• Getting CDONTS to work on Windows Server 2008 x64

    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:\Windows\SysWOW64

    2) Run regsvr32 c:\windows\SysWOW64\cdonts.dll

    3) Grant the appropriate permissions on C:\inetpub\mailroot\pickup (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= “user@example.com
        CDONTSMail.To= “user@example.com
        CDONTSMail.Subject=”This is a Test email”
        strBody = “Thank you for order from www.iislogs.com.” & 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.  http://weblogs.asp.net/steveschofield/archive/2008/03/07/detecting-permission-issues-using-auditing-and-process-monitor.aspx



6 Responsesso far.

  1. Worked like a charm, thank you very much. Saved us some time when moving from 2000/IIS5 to 2008/IIS7!

  2. Jesse Cabral says:

    The problem remained until I changed the application pool for the site to allow 32bit application support. Something for others to keep in mind.

  3. Dee says:

    For others: Some windows 2008 web edition accounts require you to run cmd as administrator to execute the regsvr32 command.

    Thanks Steve windows legend…

  4. Roeseler says:

    Thank you so much, worked like a charm!

  5. prashnat p says:

    nice artical.help me alot.

  6. Jorge says:

    I also had to grant permisions to IUSR on the c:\inetpub\mailroot folder in order to avoid a “Microsoft VBScript runtime error ‘800a0046′ Permission denied” error.

    Thanks for the tip.