Example: mapi_read_next_mail_exMS Exchange Server Functions (MAPI)

Reads the next mail in the mailbox for a specific session.

int mapi_read_next_mail_ex( MAPI *ppmapi, char *transaction, char *Show, [char *Peek,][char *Type,][char *Save,][char *MessageId,] LAST );
ppmapi A session identifier.
transaction A 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)"
Peek The peek setting. If set to true, the function just peeks at the message without reading it. The message will not be marked as read. "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: "Type=mail_type"
Save Save the body of the current message to the "Content" property: "Save=body"
MessageId Sets which mail to read next: "MessageId =<Message Id>"
LAST A marker indicating the end of the argument list.

The mapi_read_next_mail_ex function reads the next mail message in the mailbox, for the specified session. Using the Peek option, you can control whether or not to mark the mail as read or unread.

This function is for use with multiple sessions. For global sessions, use the mapi_read_next_mail function, which leaves out the session identifier.

Return Values

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

When there are no more messages in the mailbox, returns LR_MAPI_NO_MORE_MESSAGES (0x80000001).


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