Implementing Message and Recipient Options with Transport Providers

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 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 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, OPTIONCALLBACK, and OPTIONDATA.