Platform SDK: SMTP Server Events |
[This is preliminary documentation and subject to change.]
The ISMTPStoreDriver::EnumerateAndSubmitMessages method is called by the SMTP service to request that the store driver enumerate all the messages associated with the store driver and submit each to the SMTP service.
HRESULT EnumerateAndSubmitMessages([in,unique] IMailMsgNotify *pNotify);
Value | Description |
---|---|
S_OK | Success. The method 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. |
The store driver uses its internal enumerator will restore undelivered messages from the temporary store (such as the Queue directory) and submit them for delivery through the SMTP service using the ISMTPServer::SubmitMessage method. The store driver uses the ISMTPServer reference passed to the Init method to submit the messages. Likewise, all store driver implementations should cache the ISMTPServer reference passed to the Init method and use it to communicate with the SMTP service, including message submittal.
EnumerateAndSubmitMessages must be called after a successful Init call, but before any calls to AllocMessage have been performed. As such, it is normally called by the SMTP service during system startup.
Although not required, in most cases the store driver object uses the same object it creates in a call to IMailMsgStoreDriver::EnumMessages to enumerate the undelivered messages. For each message, it then binds the message to itself using the IMailMsgBind interface on the object, and then submits the message to the SMTP service.
IMailMsgNotify Interface
IMailMsgNotify.Notify
ISMTPServer Interface
IMailMsgEnumMessages Interface
ISMTPServer::SubmitMessage