Example: mapi_read_next_mailMS Exchange Server Functions (MAPI)

Reads the next mail in the mailbox.

int mapi_read_next_mail( char *transaction, char *Show, [char *options,] LAST );
transactionA transaction name for this step in quotes. To instruct VuGen not to create a transaction for this step, use a NULL string, "".
Show The show option of the mail message in the format: "Show=id | heading | summary | all (default)"
options The following options are available:
  • Peek - If set to true, the function just peeks at the message without reading it. The message will not be marked as read. Use the following format:
    "Peek=true| false(default)"
  • Type - The type of mail message. For example, IPM.Note indicates a sticky note. The default is a simple mail message. Use the following format:
  • Save - save the body of the current message to the "Content" property. See below. Use the format:
  • MessageID - Sets which message to read next. Use the format:
    "MessageId =<Message Id>"
LAST A marker indicating the end of the argument list.

The mapi_read_next_mail function reads a mail message using the MAPI server. Using the Peek option, you can control whether or not to mark the mail as read or unread.

This function is for use with global sessions. For multiple sessions, use the mapi_read_next_mail_ex function, which allows you to specify a session identifier.

The "Save=body" option saves the body of the current message to the "Content" property. This property can then be retrieved with the mapi_get_property_sz or mapi_get_property_sz_ex functions.

Return Values

If this function succeeds, it returns LR_PASS. Otherwise, it returns LR_FAIL.


All arguments of this function of the type char, can be parameterized with standard parameterization.