Mail Messages

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:

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.