Implementing Message and Recipient Options

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 page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

When the MAPI spooler logs on to a transport provider, it calls the transport object's IXPLogon::RegisterOptions method. This gives the transport provider a chance to inform the MAPI spooler about any message or recipient options it supports.

MAPI client applications call one or more special callback functions you define in a dynamic-link library (DLL) (probably in the same DLL as your transport provider) to handle any message or recipient options defined in your transport provider at the time messages are composed or submitted. The transport provider's RegisterOptions method defines and returns some arbitrary data to MAPI. This data is passed to the callback functions later when the client calls the IMAPISession::MessageOptions method. Your transport provider can use this data to indicate to the callback function what sort of option is being processed.

The transport provider's RegisterOptions method should return an array of OPTIONDATA structures describing the options supported by the transport provider. Each structure should describe one option.

Depending on how your transport provider uses the lpszDLLName and ulOrdinal members of the OPTIONDATA structure, you can implement your callbacks as one function which handles all options (and makes use of lpbOptionsData) or as many functions which handle one option each (and probably do not use lpbOptionsData).

For more information, see IXPLogon::RegisterOptions and OPTIONCALLBACK.