Web Mail Overview

Background:
ReportBuilder includes support for the ability to send exported reports through various web email services. This is done via the REST APIs provided by the supported services. The web email feature is designed with a plugin architecture allowing multiple services to be supported at once.

To register a certain plugin, simply add the unit to the uses clause of the application or use the TppSMTPPlugins class. (ppSMTPCustom.pas)

Each service is authorized using the OAuth 2.0 protocol. OAuth 2.0 allows access to a user’s account without the need for that user to provide the application any secure credentials (passwords). This is accomplished by logging into the desired service with the default secure web browser installed on the machine and obtaining temporary credentials to access the service. For more information on OAuth 2.0, please see the following article.

OAuth2 Overview

Services:

As mentioned in the OAuth 2.0 article above, each service requires the developer to register their application to access the API. Once an application is registered, a client ID, client password (secret), and redirect URI are given or created. These values need to be assigned to the proper settings in ReportBuilder in order to access the service. See the articles below for how to set up and connect to each supported service.

Web Mail Setup – Gmail

Web Mail Setup – Outlook.com

Once the client credentials have been assigned, it is possible to email a report using the web service from the Report Preview, or via code.

From the preview, select the email service to be used by using the mail toolbar button. (if more than one service has been enabled)

After the email button has been pressed, a browser window will appear asking the user to log-in to their service account followed by a number of warnings ensuring the proper application is gaining access to their email account. Once authorization is complete, the user is able to send reports for approximately one hour before re-authorization is needed.

Note: Currently if the application is closed, re-authorization is also required.