About MAPI

PowerBuilder supports MAPI (messaging application program interface), so you can enable your applications to send and receive messages using any MAPI-compliant electronic mail system.

For example, your PowerBuilder applications can:

  • Send mail with the results of an analysis performed in the application

  • Send mail when a particular action is taken by the user

  • Send mail requesting information

  • Receive mail containing information needed by the application's user

Both Extended MAPI and Simple MAPI are supported, with the exactly same set of mail objects, properties, functions and events, except for very few difference. By default, Extended MAPI is used, but if the Windows operating system being used does not support Extended MAPI, PowerBuilder 2017 R3 will use the legacy Simple MAPI.

To use Simple MAPI in PowerBuilder 2017 and later:

In the PowerBuilder IDE, add the following to the [PB] section of your pb.ini that PB uses for initialization.

[PB]
UseSimpleMAPI=yes

Default location of pb.ini is C:\Users\<username>\AppData\Local\Appeon\PowerBuilder 170.

For a deployed application, create a text file named pb.ini with the text above and deploy it with your application executable.

64-bit PowerBuilder mail applications can only work with 64-bit Windows MAPI. 32-bit PowerBuilder applications can only work with 32-bit Windows MAPI.

How MAPI support is implemented

To support MAPI, PowerBuilder provides the items listed in the following table.

Item

Name

A mail-related system object

MailSession

Mail-related structures

MailFileDescription

MailMessage

MailRecipient

Object-level functions for the MailSession object

MailAddress

MailDeleteMessage

MailGetMessages

MailHandle

MailLogoff

MailLogon

MailReadMessage

MailRecipientDetails

MailResolveRecipient

MailSaveMessage

MailSend

Enumerated datatypes

MailFileType

MailLogonOption

MailReadOption

MailRecipientType

MailReturnCode