IMessage::SubmitMessage

4/8/2010

The SubmitMessage method saves all of the message's properties, and marks the message as ready to be sent. Marked messages are automatically moved to the Outbox folder where they will be delivered during the next synchronization.

Syntax

HRESULT SubmitMessage (
  ULONG ulFlags
);

Parameters

  • ulFlags
    [in] Ignored.

Return Value

This method returns the standard values E_INVALIDARG, E_OUTOFMEMORY, E_UNEXPECTED, and E_FAIL, as well as the following:

  • S_OK
    Indicates success.
  • MAPI_E_NO_RECIPIENTS
    The message's recipient table is empty.

Remarks

MAPI passes messages to the underlying messaging system in the order in which they are marked for sending. Because of this functionality, a message might stay in a message store for some time before the underlying messaging system can take responsibility for it. The order of receipt at the destination is in the underlying messaging system's control and does not necessarily match the order in which messages were sent.

When IMessage::SubmitMessage returns, all pointers to the message and its associated sub-objects—messages, folders, attachments, streams, tables, and so on, are no longer valid. MAPI does not permit any further operations on these pointers, except for calling their IUnknown::Release methods. After IMessage::SubmitMessage is called, you should release the message and all associated sub-objects. However, if IMessage::SubmitMessage returns an error value indicating missing or invalid information, the message remains open and the pointers remain valid.

To cancel a send operation, open the Outbox folder and call IMAPIFolder::DeleteMessages on the message. Note, however, that due to timing issues, there is no guarantee that the message has not already been sent.

Requirements

Header mapidefs.h
Library cemapi.lib
Windows Embedded CE Windows CE 3.0 and later
Windows Mobile Pocket PC 2002 and later, Smartphone 2002 and later

See Also

Reference

IMessage

Other Resources

Messaging