Platform SDK: MAPI

Receiving Messages with CMC

It is slightly more complex to receive messages with CMC than to send messages.

To receive a message

  1. Establish a session by calling the cmc_logon function.
  2. Retrieve a summary of Inbox information by calling the cmc_list function.
  3. Retrieve an individual message by calling the cmc_read function.
  4. Optionally, enable a user to act on the message in the Inbox (for example, delete it) by calling the cmc_act_on function.
  5. Release memory allocated by CMC by calling the cmc_free function.
  6. End the session by calling the cmc_logoff function.

There are a number of ways you can invoke the cmc_list function in order to control the sorts of messages listed by the API. For example, you can pass in the string "CMC: NDR" in the message_type parameter to obtain a list of nondelivery reports, or you can include the CMC_LIST_UNREAD_ONLY flag in the list_flags parameter to obtain a list of unread messages.