IMAPIMessageSite::SubmitMessage

Applies to: Outlook 2013 | Outlook 2016

Requests that the current message be queued for delivery.

HRESULT SubmitMessage(
  ULONG ulFlags
);

Parameters

ulFlags

[in] A bitmask of flags that controls how a message is submitted. The following flag can be set:

FORCE_SUBMIT

MAPI should submit the message even if it might not be sent immediately.

Return value

S_OK

The call succeeded and has returned the expected value or values.

Remarks

Form objects call the IMAPIMessageSite::SubmitMessage method to request that a message be queued for delivery. The message site should call the IPersistMessage::HandsOffMessage method before submitting the message. The message does not need to have been previously saved, because SubmitMessage should cause the message to be saved if the message has been modified. After the return of SubmitMessage, the form must check for a current message and then dismiss itself if none exists.

For a list of interfaces related to form servers, see MAPI Form Interfaces.

MFCMAPI reference

For MFCMAPI sample code, see the following table.

File Function Comment
MyMAPIFormViewer.cpp
CMyMAPIFormViewer::SubmitMessage
MFCMAPI uses the IMAPIMessageSite::SubmitMessage method to save the message. First, it calls the IPersistMessage::HandsOffMessage method, and then it calls SubmitMessage.

See also

IPersistMessage::HandsOffMessage

IMAPIMessageSite : IUnknown

MFCMAPI as a Code Sample

MAPI Form Interfaces