Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
API Type: SMTP Sender.
API Interface: COM Library.
Business Logic: Sending mail via SMTP
Language Support: Works with both managed (.NET) and unmanaged code and scripting languages such as VBScript.
Direct Property Access: N/A.
Product Versions: Windows 2000 and later.
Summary:
CDOSYS has been a system component used to send email since Windows 2000. It was meant to replace CDONTS. It's primary function is an SMTP mailer which is used to send email by a port or local SMTP port. This API is still used widely today. It is supported under .NET, however you should follow the rules proper releasing the underlying COM objects when used under .NET (i.e. calling ReleaseComObject. Older versions of .NET used System.Web.Mail to send email and it was actually a .NET wrapper for CDOSYS, however it had very limited functionality. In later versions .NET included a replacement for System.Web.Mail which was written to send email using sockets calls and was writing fully in .NET - its called System.Net.Mail (SNM). While System.Net.Mail has many useful features there are some things which CDOYS would need to be used - an example of this is loading an .eml file and parsing it.
Backgrounders:
Collaboration Data Objects for Windows 2000 (CDOSYS)
https://msdn.microsoft.com/en-us/library/cc161087(v=exchg.65).aspx
CDO for Windows 2000
https://msdn.microsoft.com/en-us/library/ms527568(v=exchg.10).aspx
About CDO for Windows 2000
https://msdn.microsoft.com/en-us/library/ms527525(v=exchg.10).aspx
How to migrate the Collaboration Data Objects for NTS applications to Microsoft Collaboration Data Objects for Windows 2000
https://support.microsoft.com/kb/810702
Support policy for Microsoft Exchange APIs with the .NET Framework applications
https://support.microsoft.com/default.aspx?scid=kb;en-us;813349
Use with Programming Languages:
Unmanaged C++ | YES |
VB6 | YES |
Managed Code (.NET) | YES |
Can Run Under:
Running Under Windows Service | YES |
Running Under IIS | YES |
Running Under COM+ | YES |
Running in a Web Service | YES |
Sends Via:
Send Via MAPI Provider | NO |
Sending Via SMTP Pickup | YES |
Sending Via SMTP Port | YES |
Sending Via Submission URL | NO |
Can Save Sent Mail in Sent Items folder | NO |
Some Points Of Interest:
Homework if you wish to know more:
System.Net.Mail with SSL to authenticate against port 465
https://blogs.msdn.com/b/webdav_101/archive/2008/06/02/system-net-mail-with-ssl-to-authenticate-against-port-465.aspx
How to send digitally signed messages by using CDOSYS/CDOEX
https://support.microsoft.com/en-us/kb/280391/
How to use the Cdosys.dll library to embed a message in a new message by using Visual C#
https://support.microsoft.com/en-us/kb/310221/
How to use the CDOSYS Library to send an e-mail message by using the SMTP port in Visual Basic .NET
https://support.microsoft.com/en-us/kb/313775/
How to use the Cdosys.dll library to send an e-mail message with attachments by using Visual C#
https://support.microsoft.com/en-us/kb/310212/
Building VCALENDAR content without an Microsoft API is not supported by MS.
https://blogs.msdn.com/b/webdav_101/archive/2008/02/26/building-vcalendar-and-ical-is-not-supported-by-ms.aspx
Howto: CDOSYS/C# Sending an ICS file
https://blogs.msdn.com/b/webdav_101/archive/2008/05/05/howto-cdosys-c-sending-an-ics-file.aspx
Enumerating fields for CDOSYS, System.Web.Mail and System.Net.Mail
https://blogs.msdn.com/b/webdav_101/archive/2008/08/14/enumerating-fields-for-cdosys-system-web-mail-and-system-net-mail.aspx
Example of setting headers with CDOSYS
https://blogs.msdn.com/b/webdav_101/archive/2008/07/16/example-of-setting-headers-with-cdosys.aspx
Howto: Add a body part to a message using CDOSYS.
https://blogs.msdn.com/b/webdav_101/archive/2008/07/16/howto-add-a-body-part-to-a-message-using-cdosys.aspx
HOWTO: Set and Get the a multibyte (Japanese, Chinese, Etc) custom header with CDOSYS
https://blogs.msdn.com/b/webdav_101/archive/2008/07/24/howto-set-and-get-the-a-multibyte-japanese-chinese-custom-header-with-cdosys.aspx
Adding Inline Attachments with CDOSYS and System.Net.Mail.
https://blogs.msdn.com/b/webdav_101/archive/2008/07/31/adding-inline-attachments-with-cdosy-and-system-net-mail.aspx
CDOSYS breaks after removing Outlook Express.
https://blogs.msdn.com/b/webdav_101/archive/2008/05/06/cdosys-breaks-after-removing-outlook-express.aspx
Why is CDOSYS failing in a stored procedure?
https://blogs.msdn.com/b/webdav_101/archive/2008/02/01/why-is-cdosys-failing-in-a-stored-proceedure.aspx
How to send e-mail without using SQL Mail in SQL Server
https://support.microsoft.com/en-us/kb/312839/
CDO for Windows 2000 Library reference is unavailable in Visual Basic Project
https://support.microsoft.com/en-us/kb/318823/
Where to acquire the CDO Libraries (all versions)
https://support.microsoft.com/kb/171440/EN-US
Note that most examples of CDOSYS used under .NET do not release memory properly - ie call ReleaseComObject. Be sure to always do this and always test sending many email at tone time while testing.
Large samples:
CDOSYS Mailer
https://blogs.msdn.com/b/webdav_101/archive/2015/05/01/cdosys-mailer.aspx
CDOSYS Mailer
https://cdosysmailer.codeplex.com/
CDOSYS Mime Parser
https://cdosysmimeparser.codeplex.com/
Also see:
About: SMTP Sending APIs
https://blogs.msdn.com/b/webdav_101/archive/2015/05/28/about-smtp-sending-apis.aspx
About: Messaging APIs
https://blogs.msdn.com/b/webdav_101/archive/2015/08/07/about-messaging-apis.aspx
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in