Platform SDK: MAPI

ITnef::EncodeRecips

The ITnef::EncodeRecips method encodes a view for a message's recipient table in the TNEF data stream for the message.

Quick Info

See ITnef : IUnknown.

HRESULT EncodeRecips(
  ULONG ulFlags,                
  LPMAPITABLE lpRecipientTable  
);
 

Parameters

ulFlags
Reserved; must be zero.
lpRecipientTable
[in] Pointer to the recipient table for which the view is encoded. The lpRecipientTable parameter can be NULL.

Return Values

S_OK
The call succeeded and has 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. Such encoding is useful, for instance, 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 lpRecipientTable. 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, using the IMessage::GetRecipientTable method, and processes every row of the table into the TNEF stream 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 property in its lpPropList parameter.

Note that it is rarely necessary to call EncodeRecips unless there is some requirement for encoding 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 and thus almost never require TNEF for this.

See Also

IMessage::GetRecipientTable, ITnef::AddProps, PR_MESSAGE_RECIPIENTS