ITnef::EncodeRecips
Applies to: Outlook 2013 | Outlook 2016
Encodes a view for a message's recipient table in the Transport-Neutral Encapsulation Format (TNEF) data stream for the message.
HRESULT EncodeRecips(
ULONG ulFlags,
LPMAPITABLE lpRecipientTable
);
Parameters
ulFlags
[in] Reserved; must be zero.
lpRecipientTable
[in] A pointer to the recipient table for which the view is encoded. The lpRecipientTable parameter can be NULL.
Return value
S_OK
The call succeeded and returned the expected value or values.
Remarks
Transport providers, message store providers, and gateways call the ITnef::EncodeRecips method to perform TNEF encoding for a particular recipient table view. TNEF encoding is useful, for example, if a provider or gateway requires a particular column set, sort order, or restriction for the recipient table.
A provider or gateway passes the table view to be encoded in the lpRecipientTable parameter. The TNEF implementation encodes the recipient table with the given view, using the given column set, sort order, restriction, and position. If a provider or gateway passes NULL in lpRecipientTable, TNEF gets the recipient table from the message being encoded by using the IMessage::GetRecipientTable method, and processes every row of the table into the TNEF stream by using the table's current settings.
Calling EncodeRecips with NULL in lpRecipientTable thus encodes all message recipients and is equivalent to calling the ITnef::AddProps method with the TNEF_PROP_INCLUDE flag in its ulFlags parameter and the PR_MESSAGE_RECIPIENTS (PidTagMessageRecipients) property in its lpPropList parameter.
Note that it is rarely necessary to call EncodeRecips unless there is a requirement to encode a particular recipient table view. Foreign messaging systems almost always have facilities for handling recipient lists that are powerful enough to handle the common needs of encoding recipient lists; therefore, these systems almost never require TNEF for this purpose.