Chapter 13

Part II Summary-The Messaging API


CONTENTS


In this section of the book you learned the details of the Messaging API (MAPI) services interface and how to use the various programming tools to access MAPI services. Throughout the section you used the programming techniques and tools to build several useful desktop applications including:

You learned that there are two versions of MAPI currently active-Simple MAPI (or MAPI 0) and MAPI 1.0. Simple MAPI is available through the MAPI controls that ship with Visual Basic and through a library of Simple MAPI API calls. Most of the MAPI 1.0 features are available via the OLE Messaging Library that is shipped with the MSDN Professional Level CDs. The only MAPI services you cannot perform with the OLE Messaging Library are adding new entries to the address book, and creating and deleting folders from the message store. For this you need the power of C++ and access to the full MAPI 1.0 API set.

Here's a short summary of each of the chapters in Part II:

Chapter 3, "What Is MAPI?"

This chapter explained that the Messaging Application Programming Interface (MAPI) is a part of the Windows Open Systems Architecture (WOSA) model. MAPI is designed to offer three key benefits over other messaging services:

There are three general types of MAPI messages:

Finally, you learned about the various types of MAPI applications:

Two more application types are:

Chapter 4, "MAPI Architecture"

In this chapter you learned about the general architecture of the MAPI system. You learned that there are two main components to the system:

The MAPI Client resides on the user's desktop and handles three main MAPI objects:

Chapter 4 also reviewed the basic properties and features of MAPI messages, including message headers, folders, and address objects.

You learned that the MAPI Server usually resides on a stand-alone workstation connected to the network (although not always). Like the MAPI Client, the MAPI Server handles three main objects:

The MAPI model allows users to use multiple versions of message transports (such as Microsoft Exchange Server messages and SMTP Internet messages), message storage, and address books. You also learned about the MAPI Spooler, which moves items from the message store to the appropriate provider.

Chapter 5, "Using the Microsoft Exchange Forms Designer"

In this chapter you learned how to use the Microsoft Exchange Forms Designer kit that ships with Microsoft Exchange Server. You learned how to design, code, test, and install custom message forms for use at individual workstations or over a large network.

Topics in this chapter included:

You also learned how to set up Microsoft Exchange folders for use with custom forms. Related topics included:

Chapter 6, "Creating MAPI-Aware Applications"

In Chapter 6 you learned how to use low-level MAPI function calls to add e-mail capabilities to existing Windows applications.

You learned that MAPI-aware applications are programs that provide electronic send and/or receive services as a part of their basic feature set. Mail-aware software is able to use the available mail services in much the same way that programs use available printers, modems, or storage media (disk drives, CD-ROMs, and so on). For example, most office suite applications (word processors, spreadsheets, for example) provide a send feature on the main menu of all their programs. Basically, whatever documents you can create with the program can be sent to other locations using the mail services available on the network.

You learned to add MAPI-aware features to an Excel spreadsheet by adding a few API calls and some code to package up sections of the spreadsheet to be forwarded to another e-mail user.

You also modified a text editor project built with Visual Basic 4.0 by adding a Send... option to the main menu. In this way you added MAPI features to the application with a minimum of additional coding.

Part of this chapter described the details of the MAPI 0 API call set. This API set gives you the same abilities as the Visual Basic 4.0 MAPI controls with a few advantages:

Chapter 7, "Creating a Simple MAPI Client with the MAPI Controls"

This chapter covered two main topics:

You learned the properties and methods of the two Visual Basic MAPI controls. The MAPISession control is used to gain access to MAPI service providers through the SignOn and SignOff methods. The MAPIMessages control is used to read, create, delete, address, and send MAPI messages.

The Simple MAPI client described in this chapter showed you how to build a complete MAPI-enabled application with a minimum of coding. This example application showed how you can use the Visual Basic MAPI controls to create a fully-functional e-mail client that can read and delete incoming messages, compose new messages, address them, and send them to their recipients.

You also learned that Simple MAPI services allow only limited access to the MAPI address book. You can search and edit the address book only through the pre-defined MAPI.Show method. You cannot directly search for existing addresses or add, edit, or delete addresses without using the address dialog box supplied by the MAPI service provider.

Simple MAPI does not allow you access to any of the existing mail folders. You can only see the inbox folder and its contents.

Chapter 8, "The OLE Messaging Library"

In Chapter 8 you learned how to use the OLE Messaging Library (OML) to access features of MAPI. You learned all the major objects, their methods, and their properties.

You also wrote several code examples that inspected and modified objects and their properties. You learned to use the OLE Messaging Library to:

Chapter 9, "Creating a MAPI Mailing List Manager with the OLE Messaging Library"

In Chapter 9 you built a Mailing List Manager (MLM) using Microsoft's OLE Messaging Library. This application let users define a mailing list, allowed others to become list subscribers, published messages automatically (based on date), and allowed other users to query and retrieve old messages from the list archives. The program accepted members from within a single network, or from around the world via Internet (or other) transports.

Here are the key features of the Mailing List Manager:

The MLM application allowed individuals to create a set of text files to be distributed to a controlled list of users at specified times. This project had only one simple form and several support routines. All application rules were stored in a set of ASCII control files similar to INI/registry settings. These control values can be changed by the list manager to determine how the mailing list operates, and what features are available to subscribers.

Chapter 10, "Building a MAPI-Enabled Forum Tool"

In Chapter 10 you learned how to use the OLE Messaging Library to build a Visual Basic 4.0 application that can track discussion threads in the shared Microsoft Exchange folder. You learned how to use the ConversationIndex and ConversationTopic properties of message objects in order to track and link messages in a series of related threads.

You also used the Visual Basic 4.0 Win95 controls to create a Forum Client reader that graphically represents the progress of a discussion and allows users to read threads and add new items to a thread. You added discussion manager features that control the expiration, deletion, and archiving of threads and allow users to set memberships and security levels for discussion groups.

In addition to building your own Forum Tool with Visual Basic 4.0, you learned how to use the Folder Views options of Microsoft Exchange Client to create both personal and public views of message folders. This gives you the ability to create discussion forums within Microsoft Exchange without having to install additional MAPI software.

Chapter 11, "Creating a MAPI E-Mail Agent"

In this chapter you learned how to use the OLE Messaging Library and some API calls to create a stand-alone e-mail agent. This agent scanned your incoming mail and, based on rules you established, automatically handled messages for you. It also archived and purged old messages. All actions were based on rules you established in a control file.

Features of the e-mail agent included:

Chapter 12, "Creating Microsoft Exchange Client Extensions"

In Chapter 12 you learned how to add custom routines to your existing MAPI clients. You learned how to do this using the MAPI 0 extension interface and by using the Microsoft Exchange client extension.

You learned that there are four types of Microsoft Exchange client extensions:

You also learned that there are several possible Microsoft Exchange extension message events that you can use to build special processing routines into the Microsoft Exchange client (see Table 13.1).

Table 13.1. Microsoft Exchange client message events.
Message EventDescription
OnRead Replaces or enhances the behavior of Microsoft Exchange when reading information from a message.
OnReadComplete Enables extension objects to roll back their implementation of the OnRead method in case of an error, or to release resources allocated by OnRead.
OnWrite Replaces or enhances the behavior of Microsoft Exchange when writing information to a message.
OnWriteComplete Enables extension objects to roll back their implementation of the OnWrite method in case of an error, or to release resources allocated by OnWrite.
OnCheckNames Replaces or enhances the behavior of Microsoft Exchange when recipient names typed by the user are being resolved to their address book entries.
OnCheckNamesComplete Enables extension objects to roll back their implementation of the OnCheckNames method in case of an error, or to release resources allocated by OnCheckNames.
OnSubmit Replaces or enhances the behavior of Microsoft Exchange when a message has been submitted.
OnSubmitComplete Enables extension objects to roll back their implementation of the OnSubmit method in case of an error, or to release resources allocated by OnSubmit.

You designed a simple extension that computes and reports the size of the message at the OnRead event. You also added a simple property page to the Microsoft Exchange client to turn the size checker on and off.

You learned how to register MAPI clients by modifying the [Register] section of the local INI file. Also, you learned that there are several places where extension registration can be found, depending on the Windows platform: