Platform SDK: SMTP Server Events

IMailMsgEnumMessages::Next

[This is preliminary documentation and subject to change.]

The IMailMsgEnumMessages::Next method returns the next message's IMailMsgPropertyStream and FIO_CONTEXT context.

HRESULT Next(
  [in,unique] IMailMsgProperties *pMsg,
  [out]       IMailMsgPropertyStream **ppStream,
  [out]       PFIO_CONTEXT * ppFIOContentFile,
  [in,unique] IMailMsgNotify *pNotify
);
pMsg
Specifies the message. This may be NULL.
ppStream
Receives the reference to the message's property stream object.

ppFIOContentFile

Receives a reference to a pointer to a FIO_CONTEXT structure for the message contents.

pNotify

Interface to notify for asynchronous completion. If this value is NULL, then the operation will complete synchronously. Even if this value is non-NULL, the operation may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).

Return Values

Value Description
S_OK Success. The operation completed synchronously.
MAILMSG_S_PENDING Success. The operation will complete asynchronously. When it completes, you will be notified through the interface you passed using the pNotify parameter. The result of the operation will be returned with the notification callback method.
STG_E_NOMOREFILES Failure. There are no more undelivered messages.

See Also

IMailMsgNotify Interface

IMailMsgNotify.Notify

IMailMsgStoreDriver.EnumMessages