Platform SDK: MAPI |
A recipient list is an ADRLIST structure that contains an array of property value structures for each message recipient — destination for the message. A recipient can represent a human user, a machine, or a folder. All messages to be sent require at least one recipient that has been through the name resolution process — a process for ensuring that the PR_ENTRYID property is included in the recipient's property value array.
The properties of a recipient are a combination of address book properties and message properties. Recipient properties can apply either to all messages for a particular recipient or only to the current message. Both message store and transport providers can set recipient properties.
Each recipient must have a core set of properties in its property value array by the time the message is ready to be sent. The required set of recipient properties include:
These properties are used to access the recipient, send messages to it, and to compare it to others. Not all of these properties need to be available right away. You can add a recipient initially without knowing its entry identifier, relying on the name resolution process to assign this property. At some point before you send a message, call IAddrBook::ResolveName to make sure that all of the recipients in your recipient list are resolved. For more information about resolving recipients, see Resolving a Name.
Recipient lists can be created from messaging users or distribution list entries in an address book container or from one-offs. One-offs are recipients that are created either as temporary entries to be used only for addressing a single message or as entries to be added to a personal address book. The format for a one-off entry identifier and address is defined by MAPI. For information about these formats, see One-Off Addresses and One-Off Entry Identifiers.
You can allow users to build their recipient lists:
To create a recipient list using the common address dialog box
To create a recipient list programmatically
LPADRLIST lpAdrList = NULL; hr = MAPIAllocateBuffer(numProps * sizeof(SPropValue), (LPVOID FAR *(&lpAdrList->aEntries[0].rgPropVals); lpAdrList->aEntries[0].rgPropVals[0].ulPropTag = PR_ENTRYID; lpAdrList->aEntries[0].rgPropVals[0].Value.bin = RecipEID; lpAdrList->aEntries[0].rgPropVals[1].ulPropTag = PR_DISPLAY_NAME; lpAdrList->aEntries[0].rgPropVals[1].Value.LPSZ = szDisplay; lpAdrList->aEntries[0].cValues=numProps;