My team is tasked with migrating a Classic ASP application from a Windows 2008 Server to a Docker container (mcr.microsoft.com/windows/servercore/iis:windowsservercore-ltsc2019), with as little code-change as possible. The application uses Server.CreateObject("CDO.Message") to send email.
That line, however, results in the following error: 006~ASP 0177~Server.CreateObject Failed~800401f3/. I am given to understand from this thread, that this is because the cdosys.dll file is missing from this Windows Docker image.
It appears that the cdosys.dll file is absent in Windows Docker images, generally. I tried installing just a ton of windows features (everything .NET that was available), but none of them appear to contain this file. A team member has attempted to manually register the dll, as well, without success.
How can I use CDO.Message to send email from my Windows Docker container?
Make a wrapper class that implements the CDO.MESSAGE API.
We wrapped around System.Net.Mail
You may need to include a property for "Configuration" as well. We just removed the configuration from the ASP files instead.
You can either place it in an MSI package and set the DLL class to Register "vsdrpCOM" or run RegAsm.exe from your .NET framework folder.
ASP Classic code just needs updated to replace
Server.CreateObject("CDO.Message")withServer.CreateObject("AspClassicMail.Message")