This documentation is archived and is not being maintained.


This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

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,


[in] Reserved; must be zero.


[in] The byte count in the entry identifier pointed to by the lpEntryID parameter.


[in] A pointer to the entry identifier of the message to be processed.


Processing on the sent message was successful.


The message store provider does not support sent message processing. This error value is returned if the caller is not the MAPI spooler.

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 the PR_DELETE_AFTER_SUBMIT (PidTagDeleteAfterSubmit) and PR_SENTMAIL_ENTRYID (PidTagSentMailEntryId) 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 PR_DELETE_AFTER_SUBMIT or PR_SENTMAIL_ENTRYID is 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.


Move the message to the indicated folder.


Delete the message.

After you have taken whatever action is appropriate, call the IMAPISupport::DoSentMail method.