January 1999

Introducing the Collaboration Data Objects

One of the most exciting technologies included with Microsoft Exchange 5.5 is the Collaboration Data Objects (CDO) library, version 1.2. Designed to replace the Active Messaging 1.1 library that shipped with Exchange 5.0, the CDO provide powerful capabilities in the areas of calendaring, collaboration, workflow, and email. For developers of Web-based applications on Internet Information Server 4.0, a subset of CDO 1.2, known as the collaboration Data Objects for Windows NT Server, is available to bring the collaborative power of Exchange to your Web-based applications. In this article, we'll introduce you to CDO 1.2, explaining the core ideas. We'll also look at the CDO rendering objects, which simplify the display of Exchange data in HTML format. Finally, we'll talk about the CDO for Windows NT Server, and show you how to send email from an ASP page in just four lines of code.

The CDO object model

The CDO is designed as a log-on session containing two collections of objectsInfoStores and AddressLists. Under each collection, there are other objects, collections, properties, and methods. CDO doesn't provide a user interface to increase performance and, therefore, must be accessed through Exchange 5.5. There are no dialog boxes, log-on screens, or error message functions in the CDO.

CDO is an in-process, self-registered COM server, compatible with VBScript, Java, C/C++, Visual Basic, and Visual Basic for Applications. CDO 1.2 is fully backward compatible with existing applications developed using Active Messaging 1.1.

Furthermore, CDO is highly scaleable and was created for a high performance server environment. It supports approximately 1,000 concurrent users per server, it's thread safe, and it supports multiple code pages. Like Exchange 5.5, CDO supports caching, allowing it to perform two or three times faster than Active Messaging 1.1.

So what can I do with it?

One of the great things about CDO is that it can bring the powerful collaborative abilities of Exchange to your own Web applications. Using the CDO rendering objects, Microsoft created the Outlook Web Access Web-based application. Shown in Figure A, Outlook Web Access displays Exchange information through a Web-based application.

Figure A: Outlook Web Access was built using the CDO rendering objects.

The CDO rendering object model consists of a rendering application with two rendering objects. The ObjectRenderer allows developers to render individual objects, such as a message, a folder, or an address entry. The ContainerRenderer allows developers to render collections of such objects. Next, you'll see how you can use Collaboration Data Objects for Windows NT Server to send email.

Sending email in four lines of code

With Collaboration Data Objects for Windows NT Server, some very simple tasks are easily completed from an ASP page. One such task is the sending of email, using the NewMail object available in this library. The Collaboration Data Objects for Windows NT Server library ships with the Internet Information Server 4.0, and provides a lightweight version of the CDO 1.2 library. In Listing A, you'll see the four lines of code you can use to send an email.

Listing A: Send email in just four lines of code.

<%
DIM myMail
SET myMail = CreateObject("CDONTS.NewMail")
myMail.Send ("A.Reader@foo.com", _ "asdj@zdjournals.com",
"Test", "Test!")
SET myMail = Nothing
%>

This code works even if you don't have Exchange 5.5 installed on your Web server.

Conclusion

With the introduction of CDO 1.2, Microsoft has empowered developers with an easy way to use the collaborative features of Exchange, without having to learn a difficult API. For more information on the CDO and the Collaborative Data Objects for Windows NT Server, visit the Exchange Web site at www.microsoft.com/exchange.

Copyright © 1999, ZD Inc. All rights reserved. ZD Journals and the ZD Journals logo are trademarks of ZD Inc. Reproduction in whole or in part in any form or medium without express written permission of ZD Inc. is prohibited. All other product names and logos are trademarks or registered trademarks of their respective owners.