Windows CE uses the MailMsg structure to encapsulate information about a mail message. The data structure contains the following elements:
You must create and initialize a MailMsg structure in order to use it to read and write messages to and from the message store. If you declare a MailMsg structure on the stack, to be sure that the structure is cleanly initialized, you should call:
memset(&MailMsg, 0, sizeof(MailMsg));
The unique object identifier is registered as the oid member of the MailMsg structure. You use this identifier for direct access to messages in the message store. There are a number of flags you can use to perform specific operations on the message. These flags are assigned to the dwFlags member of the MailMsg structure. The mail and transport functions assign flags to denote the status of the message. You can assign flags to specify how to handle a message. For example, you can selectively retrieve messages of certain types, and you can flag a new message to be sent after the user issues the Send command.
Mail flags are divided into four categories:
Determine which folder to locate or store the message in, or which folder the message will be moved or copied into. The flags have the MAIL_FOLDER_ prefix.
Determine the type of message being searched for before a call is made to retrieve a message. After the function call they contain the status of the message. The flags have the MAIL_STATUS_ prefix.
Determine how much of the message is read into memory when the message is retrieved. The flags have the MAIL_ prefix.
Determine the status of message attachments and the mode of operation to be performed on them. The flags have the ATT_ prefix.
When you assign MAIL_FOLDER_SENT to dwFlag, the system will move the message to the Sent Items folder. Messages that are flagged with MAIL_STATUS_DELETE are displayed in the Deleted Items folder and are invisible from the original folder. MAIL_STATUS_ATTACHMENTS indicates that the message has attachments. If you want to fetch the full body of a message from the message store, set dwFlags to MAIL_FULL. All the mail flags are defined in the Msgstore.h header file.