The MailGet function retrieves a mail entry from the message store.
BOOL MailGet (HANDLE hMail, MailMsg* pmm);
Header file: | Msgstore.h |
Platforms: | H/PC |
Versions: | 1.0 and later |
When MailGet returns, this structure contains the message retrieved from the message store. Two of the message flags determine how much of the message to retrieve. If MAIL_GET_FLAGS is set, only the flags and the object identifier are returned. Using this option does not require any memory to be allocated for the message. If the MAIL_GET_BODY flag is set, the entire message is loaded into memory. This requires the system to allocate memory from the global heap. If neither of these flags is set, all of the message except the body (that is, the header) is retrieved. Memory for this option is allocated from the private heap. To free memory allocated by this function, use the MailFree function.
This function returns TRUE if successful; FALSE if it fails. To get extended error information, use MailError or MailErrorMsg.
The entry retrieved is based on the value of the oid member of the MailMsg structure when the MailGet function is called.
Changing the values of the MailMsg variable does not affect the message store until the message is reinserted by calling the MailUpdate function.
For more information about mail flags, see MailMsg. For more information, see Inbox.