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.
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.
Collaboration Data Objects for Windows 2000 (CDOSYS)
CDO for Windows 2000
About CDO for Windows 2000
How to migrate the Collaboration Data Objects for NTS applications to Microsoft Collaboration Data Objects for Windows 2000
Support policy for Microsoft Exchange APIs with the .NET Framework applications
Use with Programming Languages:
|Managed Code (.NET)||
Can Run Under:
|Running Under Windows Service||
|Running Under IIS||
|Running Under COM+||
|Running in a Web Service||
|Send Via MAPI Provider||
|Sending Via SMTP Pickup||
|Sending Via SMTP Port||
|Sending Via Submission URL||
|Can Save Sent Mail in Sent Items folder||
Some Points Of Interest:
- Works with .NET.
- It’s a Windows component.
- Because its a windows component you should not include the CDOSYS DLL in your application. The same goes for ADODB which will automatically get referenced when you set a reference to CDOSYS.
- Can build complex email.
- Can load and parse an email (email) file.
- Older versions of Exchange included an API called CDOEX, which was a super-set of CDOSYS. In addition to what CDOSYS could do, CDOEX could be used for working with items in a mailbox.
- The older versions of Windows included a mail client called Outlook Express which used CDOSYS to send email.
- Sending email by SMTP pickup folder is more efficient than sending by SMTP port. This approach is recommended when sending a lot of email.
- CDOSYS can send email against more variations of SSL enabled ports than System.Net.Mail.
- System.Web.Mail was an early .NET wrapper for CDOSYS, however it did not expose all the capabilities of CDOSYS. Later a full .NET sockets based SMTP sender called System.Net.Mail was created which replaced System.Web.Mail. System.Net.Mail has some features which CDOSYS does not, however it does not fully replace the capabilities which CDOSYS has.
Homework if you wish to know more:
System.Net.Mail with SSL to authenticate against port 465
How to send digitally signed messages by using CDOSYS/CDOEX
How to use the Cdosys.dll library to embed a message in a new message by using Visual C#
How to use the CDOSYS Library to send an e-mail message by using the SMTP port in Visual Basic .NET
How to use the Cdosys.dll library to send an e-mail message with attachments by using Visual C#
Building VCALENDAR content without an Microsoft API is not supported by MS.
Howto: CDOSYS/C# Sending an ICS file
Enumerating fields for CDOSYS, System.Web.Mail and System.Net.Mail
Example of setting headers with CDOSYS
Howto: Add a body part to a message using CDOSYS.
HOWTO: Set and Get the a multibyte (Japanese, Chinese, Etc) custom header with CDOSYS
Adding Inline Attachments with CDOSYS and System.Net.Mail.
CDOSYS breaks after removing Outlook Express.
Why is CDOSYS failing in a stored procedure?
How to send e-mail without using SQL Mail in SQL Server
CDO for Windows 2000 Library reference is unavailable in Visual Basic Project
Where to acquire the CDO Libraries (all versions)
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.
CDOSYS Mime Parser
About: SMTP Sending APIs
About: Messaging APIs