Important:
This is retired content. 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 content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
4/8/2010

The SubmitMessagemethod saves all of the message's properties, and marks the message as ready to be sent. Marked messages are automatically moved to the Outboxfolder 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::SubmitMessagereturns, 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::Releasemethods. After IMessage::SubmitMessageis called, you should release the message and all associated sub-objects. However, if IMessage::SubmitMessagereturns an error value indicating missing or invalid information, the message remains open and the pointers remain valid.

To cancel a send operation, open the Outboxfolder and call IMAPIFolder::DeleteMessageson 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