Is System.Web.Mail really a wrapper around the COM CDONTS and CDOSYS?
Yes. System.Web.Mail is not a full .NET native implementation of the SMTP protocol. Instead, it uses the existing CDONTS and CDOSSYS dlls already written by Microsoft some years ago.
This can best be demonstrated by using Anakrino and reflecting into the SWM namespace and SmtpMail class.
Inside of the SmtpMail class are two private classes called CdoNtsHelper and CdoSysHelper.
Under the covers, CdoNtsHelper creates the CDONTS.Newmail object, while the CdoSysHelper creates the CDO.Message class.
This can best be seen in the two screen shots CdoNtsHelper.gif and CdoSysHelper.gif.
Another interesting fact, is how SWM decides to use either the CDONTS.Newmail or the CDO.Message object.
When the SmtpMail class sends the MailMesage, the SmtMail class checks the OS version. If the version is <= 4, the CDONTS.Newmail object is used.
For all OS’s greater than 4, the CDO.Message object is used. Again, using Anakrino, the SmtpMailSend.gif screen shot verifies this behavior.
Because of this condition, troubleshooting SWM can become interesting, when moving the code to different OS’s.
Copyright © 2004 Contact: Dave Wanta.