IMAPISupport::PrepareSubmit

The IMAPISupport::PrepareSubmit method prepares a message for submission to the MAPI spooler.

Quick Info

See IMAPISupport : IUnknown.

HRESULT PrepareSubmit(
  LPMESSAGE lpMessage,   
  ULONG FAR * lpulFlags  
);
 

Parameters

lpMessage
[in] Pointer to the message to prepare.
lpulFlags
[in, out] On input, the lpulFlags parameter is reserved and must be zero. On output, lpulFlags must be NULL.

Return Values

S_OK
The message was successfully prepared.

Remarks

The IMAPISupport::PrepareSubmit method is implemented for message store provider support objects. Message store providers call PrepareSubmit in their implementation of IMessage::SubmitMessage to prepare a message for submission to the MAPI spooler.

PrepareSubmit is used to handle messages that have the MSGFLAG_RESEND flag set in their PR_MESSAGE_FLAGS property. MSGFLAG_RESEND is set for messages that include a request to be resent when an initial transmission fails. PrepareSubmit determines which of the recipients in the recipient list successfully received the message and which did not.

To access the recipient list, PrepareSubmit calls the message's IMessage::GetRecipientTable method. To retrieve the recipient data, PrepareSubmit calls the recipient table's IMAPITable::QueryRows. For each row in the table, PrepareSubmit checks PR_RECIPIENT_TYPE, and:

Notes to Callers

Before you call PrepareSubmit, make sure you have called IMAPISupport::SpoolerNotify and set the NOTIFY_READYTOSEND flag in the ulFlags parameter. The SpoolerNotify call must be made once per session before the call to PrepareSubmit. SpoolerNotify synchronizes the MAPI spooler and ensures that all needed transport providers are logged on and their address types registered.

See Also

IMAPIFolder::GetMessageStatus, IMessage::SubmitMessage