The IMsgStore::FinishedMsg method enables the message store provider to perform processing on a sent message. This method is called only by the MAPI spooler.
HRESULT FinishedMsg(
ULONG ulFlags,
ULONG cbEntryID,
LPENTRYID lpEntryID
);
The IMsgStore::FinishedMsg method performs processing on a sent message. This processing can involve deleting the message, moving it to a different folder, or both actions. The type of processing depends on whether or not the PR_DELETE_AFTER_SUBMIT and PR_SENTMAIL_ENTRYID properties are set.
In your implementation of FinishedMsg, unlock the message identified by lpEntryID and perform the appropriate processing. The target message will always be locked; the MAPI spooler never passes the entry identifier for an unlocked message to FinishedMsg.
It is possible that neither of these properties are set, both are set, or one or the other is set. The following table describes the action you should take based on the settings:
If neither property is set: | Leave the message in the folder from which it was sent (typically the Outbox). |
If both properties are set: | Move the message to the indicated folder, if desired, and then delete it. |
If PR_SENTMAIL_ENTRYID is set: | Move the message to the indicated folder. |
If PR_DELETE_AFTER_SUBMIT is set: | Delete the message. |
After you have taken whatever action is appropriate, call IMAPISupport::DoSentMail.