Starting a MAPI Session
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.
Although there is a significant amount of work performed during session start up, the required tasks are minimal. Much of this work is done in the MAPI processing of the MAPIInitialize and MAPILogonEx calls. Both of these functions accept flags as input parameters for controlling aspects of the session such as notification handling and the user interface. It is important to understand the consequences of setting each of these flags when calling MAPIInitialize to initialize the MAPI libraries and MAPILogonEx to log on to the MAPI subsystem.
To start a MAPI session
Call MAPIInitialize to initialize the standard set of MAPI libraries.
If you need to use the OLE libraries, call the OLE function OleInitialize.
If you need to use the MAPI utility library, call ScInitMapiUtil.
Call MAPILogonEx with a valid profile to log on to the MAPI subsystem. MAPILogonEx verifies the configuration of each of the service providers in the message services included in the profile, prompting the user for additional information if necessary and possible. When MAPILogonEx completes, the configured service providers are ready for service.