Platform SDK: MAPI

Messages

Messages are MAPI objects that are transmitted from one client application to another through the MAPI spooler and service providers by way of a messaging system. Nearly every component in MAPI works with messages. Clients allow users to create, save, send, and delete messages as well as copy and move them from one folder to another. Message store providers are responsible for providing the means for message management and for delivering messages to the MAPI spooler or a transport provider. The MAPI spooler moves messages to an appropriate transport provider while transport providers handle the delivery and receipt of messages to and from a messaging system and set recipient and message option properties. Address book providers work indirectly with messages, supporting properties that are used to describe message recipients.

Messages are stored in folders within a message store, typically folders created within the Interpersonal Message (IPM) root folder. Messages are usually stored at the same level as the standard IPM Inbox, Sent Items, Deleted Items, and Outbox folders, or at lower levels in the hierarchy. However, messages can be stored outside the IPM subtree as well.

Messages created in the standard IPM subtree are messages with standard contents, or contents that are visible to the user of a client application. Notes and reports are examples of messages with standard contents. Messages can also be created with associated contents, or contents that are not visible in the typical client. Associated messages are examples of messages that are created in folders outside of the IPM subtree. Folders support two different contents tables to hold the different types of messages: a standard contents table for standard messages and an associated contents table for associated messages. Because MAPI does not set standards for the content of associated messages, they can contain arbitrary information.

A message can have additional data, in the form of a file, another message, or an OLE object, associated with it. This additional data, called an attachment, appears either as an icon or metafile in the message text. A message can have zero attachments, one attachment, or many attachments. Attachments are always transmitted with the message.

A message that is transmitted has one or more recipients, or addresses associated with a particular messaging system. Some recipients are entries in a container belonging to an address book provider in the current profile; other recipients are created solely to be used to transmit the message. Because recipients and attachments must be accessed through the message with which they are associated, a message's recipients and attachments are known as its subobjects.

Message store providers support messages, attachments, and recipients through methods in three interfaces:

Interface Description
IMessage Manages attachments and recipients, sends messages, sets read status.
IMAPIFolder Creates, copies, moves messages and subfolders and manages message status.
IAttach Manages attachment properties.