Platform SDK: MAPI |
The lpszMessageType member of the MapiMessage structure indicates the type of the message. The most common type is the interpersonal message, or IPM. A NULL value for lpszMessageType or a pointer to an empty string indicates an interpersonal message. Client applications can use this member to define their own message types. Be aware that not all messaging systems support message types other than IPM. Those messaging systems will ignore lpszMessageType.
The lpszMessageType member is also used to indicate when a message is a nondelivery report (NDR). The messaging system formats the nondelivery for a message type as REPORT. plus the message type plus .NDR. For example, if your client uses a message type of mytype, the nondelivery report for such a message will have REPORT.mytype.NDR as its lpszMessageType string. For clients that deal with multiple types of messages, your client can compare the last four characters of the lpszMessageType string against .NDR to determine whether the message is a nondelivery report. Naturally, you should not choose a string that ends in .NDR as an internal message type.
Note While nondelivery reports generated by MAPI follow this convention, nondelivery reports generated by transport providers for external mail delivery systems might not.
The flFlags member can be used to request a receipt and to detect the read or unread and sent or unsent status of a message. When sending a message, you can set the MAPI_RECEIPT_REQUESTED flag to request a receipt. When reading a message, you can test for the MAPI_UNREAD flag to determine whether the message has not yet been read. Similarly, you can test for the MAPI_SENT flag to determine whether the message has been sent. When saving a previously unsaved message, you should set the MAPI_UNREAD and MAPI_SENT flags as appropriate for the message.