0

We have a classic ASP application we just migrated from Windows 2008 R2 to Windows 2012 R2 Core.

Apparently Core versions of windows don't include cdosys or cdonts and thus our application can no longer send email.

Most of the advice I can find suggests using system.net.mail for sending email which of course is a .NET technology and we're using classic ASP.

We do have .NET on our system but I'm not sure if classic ASP could talk to a .NET page for sending email?

Besides using a 3rd party COM utility like Persits ASPEmail are there any native ways of working around this?

We do NOT want to convert the server core instance to the full version of windows. That's killing an ant with a bazooka. This is only impacting two places in our code and everything else works just fine on core.

Brad
  • 1,979
  • 7
  • 35
  • 47
  • I had this issue myself and [found the answer](http://stackoverflow.com/a/42509944/692942). – user692942 Apr 26 '17 at 17:25
  • AFAIK third party email components like ASPEmail are just wrappers for CDO. I've never tried this for sending emails, but it should be possible to use msxml to post data to an asp.net webform. See this question - http://stackoverflow.com/questions/1463635/how-to-perform-an-http-post-request-in-asp – John Apr 27 '17 at 14:41
  • @John in that particular question the issue was slightly different, I posted that answer as a workaround, but it never really directly answered that question. In hindsight, I should have posted a question and answered it myself. – user692942 Apr 29 '17 at 14:57

1 Answers1

0

Unfortunately, CDONTS was superseded by CDOSYS some time ago. When migrating from Windows Server 2008 to Windows Server 2012 I had this exact same issue, but managed to find a fix.

It involves taking a copy of the cdonts.dll file from the Windows Server 2008 Server and adding it to the Windows Server 2012 server then registering it with the relevant COM subsystem without any need to change code or install a 3rd Party library.

Hopefully the same method will work with Core but I haven't tested it.

Community
  • 1
  • 1
user692942
  • 16,398
  • 7
  • 76
  • 175
  • I didn't try CDONTS, but I did try that trick with CDOSYS and it doesn't work :( I suppose I could try CDONTS for giggles. – Brad Apr 26 '17 at 17:54
  • @brad I've never tried it with CDOSYS only CDONTS, it depends how the CDO objects are instantiated in code. If it's `Server.CreateObject("CDONTS.NewMail")` its `cdonts.dll` that needs copying and registering. If it didn't work, might be due to the app pool in IIS not being enabled for 32 bit when the dll is being registered in the 32 bit registry. It can be minefield, have a guide on registering COM [here](http://stackoverflow.com/a/35985827/692942). – user692942 Apr 26 '17 at 18:10
  • @Lankymart - Does CDONTS actually work on current versions of IIS? In my experience with IIS7 and above CDOSYS has always needed a config section even when the SMTP server is on the same machine. This makes me suspect that CDONTS would be useless in the same environment. – John Apr 29 '17 at 14:06
  • @John it's just COM, if you can find the DLL and register it, yes it works. I have this running on a Windows Server 2012 to support an old ASP site that used it. – user692942 Apr 29 '17 at 14:53