Receiving Messages with CMC
It is slightly more complex to receive messages with CMC than to send messages.
To receive a message
-
Establish a session by calling the cmc_logon function.
-
Retrieve a summary of Inbox information by calling the cmc_list function.
-
Retrieve an individual message by calling the cmc_read function.
-
Optionally, enable a user to act on the message in the Inbox (for example, delete it) by calling the cmc_act_on function.
-
Release memory allocated by CMC by calling the cmc_free function.
-
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.