One way to see if Simple MAPI is available is to check the [Mail] section in the WIN.INI file for the MAPI entry. This entry will have a value of 1 if Simple MAPI is installed; 0 if it is not installed. For example, the entry will be the following if Simple MAPI is available:

[Mail]

MAPI=1

Microsoft Outlook or Outlook Express V4.0 or higher install the necessary Simple MAPI components (MAPI32.DLL). Other MAPI e-mail compliant programs may be used including Eudora Mail.

If you are not sure if MAPI is configured, you can log in manually by setting the MAPI_LOGON_UI$ flag (found in MAPI_EQUATES). Then use the name of the profile as the third parameter (the user name) of MAPILogon(), to logon automatically using that profile. For example, if your Microsoft Outlook profile name is Outlook Internet Settings call MAPILogon() as follows:

MAPILogon (session, @window , 'Outlook Internet Settings', '')

The following BASIC+ function will check if simple MAPI is available:

Function MAPIInstalled(Var)
* This function will return 1 if MAPI is installed or 0 if not
Declare Function GetPrivateProfileString
Result = str( \00\, 16 )
resultLen = GetPrivateProfileString( "Mail":\00\, "MAPI":\00\,"0":\00\, result, len( result ), "WIN.INI" )
If (result[1,\00\] ) = 1 then
  * // MAPI is installed
  Installed = 1
End Else
  * //  MAPI not installed
  Installed = 0
End
Return Installed
  • No labels