With Microsoft ending the support on Windows 2003, many classic ASP applications that use cdonts.dll to send automatic emails (cdonts.newmail) still need to be migrated to the newer server (Windows Server 2012 R2). One way you can tell an application is using it is when you encounter the following error message on your browser.
CDONTS was already deprecated since Window 2000 and completely removed in Windows 2003. The ideal way to do it is to use the newer and more robust cdosys.dll. But in practicality, this will require a code re-write and many companies with legacy applications just don’t want to spend the time or money to do so. So you just to move all the codes and make them work the same way on Windows Server 2012 R2 which is 64-bit only.
Here are the steps to make cdonts.dll work on the current Windows Server 2012 R2. Please note, that the DLL itself is no longer available on the server as it is replaced with cdosys.dll. You also need to install an internal SMTP server first prior to performing these steps below or else you won’t be able to configure the permission on the mail pickup directory (Step 4).
Steps
Copy CDONTS.DLL from the old server Windows Server 2003 (C:\WINNT\system32).
Paste the DLL to the Windows Server 2012 R2 (C:\Windows\SysWOW64).
Launch Command Prompt (Admin) and type
regsvr32 C:\Windows\SysWOW64\cdonts.dll
Grant the required permissions on C:\inetpub\mailroot\pickup (or whichever mail directory you use if not the default). Typically, at the very least, you want to grant USERS group with Modify permissions.
Reset IIS or restart the server (if not PROD).
Test the application.
One last thing, we noticed that Windows Server 2012 R2 is more restrictive for e-mail formatting. You need to use an FQDN for your From: e-mail address. On Windows 2003, you can use any one-word “address” (i.e., From: “MySender”). On Windows Server 2012 R2, you need to add [email protected]. The e-mail format needs to be valid whether or not the e-mail address itself is legit.
We have used this method to migrate a dozen of ASP applications and this will buy more time for at least another eight more years before we need to re-write most of our applications.
Further Reading
Mastering Windows Server 2019
Mastering Windows Server 2016 Hyper-V