This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.
This topic provides information about using Messaging Application Programming Interface (MAPI) to develop messaging applications.
MAPI can be used to access items and folders within public and private stores, as well as the properties stored along with each item. MAPI is used by various industry-standard e-mail clients, such as the Microsoft® Exchange client, all versions of Microsoft Outlook®, and Outlook Express. Developers can create clients that use MAPI, as well as MAPI servers and MAPI forms handlers. The information here only applies to MAPI client applications that access Exchange.
MAPI is a mature mechanism used to access information in Exchange, and provides some capabilities available in no other API. However, MAPI does not work well outside an intranet, maintains an open connection for the duration of the MAPI session, and can be difficult to learn.
Client applications that use MAPI access user mailbox and public folder information stored in Exchange, and user directory information stored in Active Directory. Client applications that use MAPI are typically e-mail clients and applications that require complex e-mail processing.
MAPI objects are all obtained through the IMAPISession object. The session object provides the client access to objects for working with MAPI profiles, status, message service provider administration, message store tables, and address books. The message store table contains objects for the message store, folders, messages, attachments, and recipients. The address book tables contain objects for messaging users and distribution lists.
Data Access Model
MAPI represents messages and users in hierarchical object fashion.
No specific threading prohibitions. However, applications that use free-threading should avoid sharing MAPI object instances among threads due to the high costs of marshalling the object. MAPI and MAPI service providers use free-threading.
MAPI client applications are typically Windows forms-based client applications. However, N-tier applications can be written that use MAPI.
MAPI uses Remote Procedure Calls (RPC) to communicate with the Exchange server. Typically RPC is intentionally blocked from passing through Internet firewalls.
MAPI does not support transactions.
Information about this is not yet available here.
A MAPI stub currently ships with all versions of Windows. Microsoft Office installs its own MAPI subsystem when installing Outlook. No changes to MAPI are anticipated at this time.
You can only directly access MAPI by using C or C++.
MAPI is an unmanaged component. Use of MAPI is not supported under the COM Interoperability layer of Visual Studio .NET and the .NET Framework. MAPI can be run on many 16- and 32-bit versions of Windows.
MAPI cannot be directly used in scripts.
No special debugging tools are needed to debug applications that use MAPI.
Expert MAPI programmers can be difficult to find, and learning the technology can take a significant amount of time. In addition to the Microsoft communities, there are a relatively small number of high-quality third-party Web sites that provide helpful MAPI development information.
Both Microsoft and third-party books describing MAPI programming are available. For more information about MAPI, see the MSDN Web site .
No special licensing is required for developing by using MAPI.
The developer must have permissions to access the data in the Exchange store. Exchange stores user and distribution list information in Active Directory, so developers who create MAPI client applications that access that information must have the ability to retrieve and set that information.
Setting up MAPI-based applications typically requires the user to be a local administrator, or to have rights to install software.
Running a MAPI-based application usually only requires that the user have sufficient permissions to access the data on the Exchange store.
Built-in Security Features
MAPI profiles can be password protected on most platforms.