Differences between SMTP and MAPI

Before you decide which approach (SMTP or MAPI) to take, be aware of the following differences between the current SMTP and MAPI solutions.

MAPI has the following limitations. Note that these limitations can be overcome if using SMTP.

  • Email client must be installed on the client computer

    Email client such as Microsoft Outlook must be installed on the client computer.

  • Relies on the email client platform

    If the PowerBuilder application is 32-bit, then the email client must also be 32-bit, otherwise it will fail to call MailLogon function.

  • Relies on the current email account

    You can only use the email account configured by each client to send email, but cannot use the system email account to send email uniformly.

  • Cannot send email with RichText content

    Only plain text can be used in the email body.

  • Limitations of Simple MAPI

    Extended MAPI is not supported in PowerBuilder 2017 and later, so UseSimpleMAPI=yes needs to be added to the [PB] section of your pb.ini that PB uses for initialization.

    After setting UseSimpleMAPI, a Microsoft Outlook warning window will pop up when sending email, and you need to manually click the Allow button to send email, which cannot be automatically sent.


  • Various versions of email client

    The PowerBuilder program can run on various Windows operating system, including Windows Server. The email client also has multiple versions to run on different operating systems. If PowerBuilder calls MAPI in different environments, the exceptions will easily occur.

The current SMTP solution has the following limitations:

  • Does not support the exchange protocol

    The SMTPClient object does not support sending email by the exchange protocol. You need to activate the SMTP protocol in the Exchange Server.

  • Does not support ImportHTML function

    When you want to send an email using the HTML file as the email body and the external resource is referenced in the HTML file, the ImportHTML function can automatically import the HTML file into the email body and associate the external resource. But now you need to add the external resources to the resource pool through the AddLinkedResource function, and then reference this resource in the HTML source code.

  • Does not support SSL

    SSL is no longer supported. The following connection types are supported: None (Plain text); STARTTLS, and Auto STARTTLS.

  • Does not support to set the amount of threads used by async calls

  • Does not support to set the number of connection attempts the SMTP client will try to connect to the server