Message Heap

Opening a message usually creates a private heap for dynamic storage of data from the message store. A handle to this private heap is registered as the hHeap member of a MailMsg structure, discussed later in this chapter. To optimize memory use, you should free the private heap when you are done with the message by calling the MailFree function. To prevent fragmentation of the global heap, use local heaps to work with mail messages. To conserve the memory resource, open messages one at a time.