Description
Begins a session with the MAPI messaging system.
Syntax
status = MAPILogon(session[, parent][, user][, password][, flags])
Parameters
The MAPILogon function has the following parameters.
Parameter | Description |
---|---|
session | On output contains the handle of a session with the MAPI messaging system. |
parent | Contains the name of an OpenInsight parent window. If not specified any dialog box displayed will be application modal. |
user | Contains the name of the MAPI client account to be logged on. |
password | Contains the password of the MAPI client account to be logged on. |
flags | Contains information about session initiation and message downloading. It could be MAPI_LOGON_UI$, MAPI_NEW_SESSION$, MAPI_FORCE_DOWNLOAD$, or a combination of these flags.
The insert record MAPI_EQUATES contains these flags. You may combine flags by adding them together with an addition sign (+). |
After the function completes successfully the session parameter will contain a valid MAPI session handle which may then be used as input to further MAPI function calls.
Returns
1 for successful execution or 0 for failure.
If function execution fails, you can retrieve a text error message by calling the Get_Status function. For example, to display an error message on the screen, include the following error handling routine in your code:
Get_Status(ErrMsg)
Msg(@window, ErrMsg)
See also
Example
Subroutine DemoMAPILogon(var) * Logs on to MAPI and logs off $INSERT MAPI_EQUATES Declare Function MAPILogon, MAPILogoff Declare Subroutine Msg, Get_Status if MAPILogon(session) then if MAPILogoff(session) then Msg(@window, "Logon and logoff successful") end else Get_Status(display) Msg(@window, display) end end else Get_Status(display) Msg(@window, display) end return