Platform SDK: MAPI

Sending Messages with CMC

You send messages with CMC by building a CMC_message structure and passing it to the cmc_send function. Fill in the members of the CMC_message structure depending on the parameters used to invoke cmc_send. For example, if you pass the CMC_LOGON_UI_ALLOWED flag to cmc_send, then you don't need to provide a list of recipients, a subject line, or message text because CMC will query the user for that information.

When you call the cmc_send function, it must provide a session handle, a pointer to a CMC_message structure, any necessary flags, an optional user interface identifier if the flags include the CMC_LOGON_UI_ALLOWED flag, and optional extensions. Once cmc_send returns, you have no further responsibility for sending the message.

To send a message

  1. Establish a session with the messaging system either through the cmc_logon function or interactively by sending the CMC_LOGON_UI_ALLOWED flag value with the cmc_send function.
  2. Submit a message to the submission queue. Usually, a client application does so through the cmc_send function. If you call cmc_send, you must first create a CMC_message structure to pass to the cmc_send function. You can also call the more limited cmc_send_documents function to send a message; this function is primarily used to send messages or files from macro languages.
  3. End the session by calling the cmc_logoff function.