Skip to content

Latest commit

 

History

History
78 lines (55 loc) · 2.25 KB

MAPILogon.md

File metadata and controls

78 lines (55 loc) · 2.25 KB

Home

Function name : MAPILogon

Group: Simple MAPI - Library: mapi32


The MAPILogon function begins a Simple MAPI session, loading the default message store and address book providers.


Code examples:

Open and close a Simple MAPI Session
Sending email messages with Simple MAPI
How to read email messages using Simple MAPI

Declaration:

ULONG FAR PASCAL MAPILogon(
  ULONG ulUIParam,
  LPTSTR lpszProfileName,
  LPTSTR lpszPassword,
  FLAGS flFlags,
  ULONG ulReserved,
  LPLHANDLE lplhSession
)  

FoxPro declaration:

DECLARE INTEGER MAPILogon IN mapi32;
	INTEGER ulUIParam,;
	STRING lpszProfileName,;
	STRING lpszPassword,;
	INTEGER flFlags,;
	INTEGER ulReserved,;
	INTEGER @lplhSession  

Parameters:

ulUIParam [in] Parent window handle or zero, indicating that if a dialog box is displayed, it is application modal.

lpszProfileName [in] Pointer to a null-terminated profile name string, limited to 256 characters or less. This is the profile to use when logging on.

lpszPassword [in] Pointer to a null-terminated credential string, limited to 256 characters or less.

flFlags [in] Bitmask of option flags.

ulReserved Reserved; must be zero.

lplhSession [out] Simple MAPI session handle.


Return value:

Returns SUCCESS_SUCCESS (0) in case if the call succeeded and a Simple MAPI session was established; or one of the predefined MAPI_E_* values otherwise.


Comments:

In my testing this function used to change active directory to the one of the Outlook Express -- default MAPI provider on my computer.

MSDN: Determine that Simple MAPI is available by checking the [MAIL] section in the computer"s WIN.INI file for the MAPI entry. This entry will have a value of 1 if Simple MAPI is installed, or 0 if uninstalled.

Check example in this reference: Reading keys in the specified section of the Win.ini file -- this is how to test Simple MAPI availabliilty on the local computer.