Technical Support Hours

M-F 8am to 8pm (EST)

Start a conversation

OAuth for Microsoft Outlook 365 and Google Gmail

Overview

SalesPad versions 5.2.33 and above can use OAuth when sending email via Microsoft Outlook 365 or Google Gmail. OAuth provides more security than basic authentication and receives much better support from Microsoft and Google.

Setup

There are two ways to configure SMTP (Simple Mail Transfer Protocol) accounts within SalesPad: the Sales Email Confirmation settings and the SMTP Setup module. Each method has pros and cons:

  • Sales Email Confirmation only supports one SMTP account, while SMTP Setup supports multiple SMTP accounts. However, if configured correctly, a single SMTP account can unlock access to other email accounts within the same domain depending on the email server configuration.
  • As of version 5.2.33, every piece of emailing functionality in SalesPad has the capability of using the Sales Email Confirmation account, while only a subset of emailing functionality supports using the current user’s SMTP Setup account.
  • Sales Email Confirmation is easier to set up and maintain since its SMTP account is shared among all users, while SMTP Setup accounts are usually tied to a single system user.

Note: SalesPad’s Google OAuth functionality uses Gmail API instead of contacting Google’s SMTP server directly, but for the sake of simplicity the mentioned setup modules and this documentation will incorrectly imply that Gmail API is a form of SMTP.

Sales Email Confirmation

The Sales Email Confirmation account can be set up within the Settings module. Search for ‘Sales Email Confirmation’ to show the relevant settings.

Fill out the SMTP User setting. You may either manually type in a user, or use the setting’s ellipses button to sign in to Microsoft or Google and use the email address you select during that process. If you sign in, SalesPad will save the resulting access token to the database, so you and other users will not have to sign in again later.

Next, fill out the remaining settings. The following table provides the typical values for Outlook 365 and Gmail. Alternate values may work for Outlook 365, whereas Gmail is locked down to the following configuration:

Setting
Outlook 365
Gmail
Email Server hostname
smtp.office365.com
gmail.googleapis.com
SMTP OAuth Service Provider
Microsoft
Google
SMTP Port
587
443
Enable SMTP over SSL or TLS
True
(ignored)
SSL or TLS Startup Method
Auto
(ignored)
SMTP Timeout
100000
(ignored)

 ‘Email To Fax Format String’ also appears in the Sales Email Confirmation category, but is not directly related to SMTP configuration.

SMTP Setup

SMTP Setup accounts can be configured within the SMTP Setup module. Open that module to view the current list of SMTP accounts.

Users can add and edit SMTP accounts from this module by clicking the respective buttons in the header. Both buttons will open this screen:

The quickest way to add a new OAuth configuration is to click the ‘Sign In’ button. After clicking that button, click ‘Sign in with Google' or ‘Sign in with Microsoft’ to sign in with the selected service provider.

After signing in, SalesPad populates most of the fields with information from the sign-in process. If using Microsoft OAuth, the Hostname, Port, and SSL fields can be changed from their recommended defaults as needed. SalesPad also saves the access token from the sign-in process to the database, so you and other users will not have to sign in again later.

Finally, fill out the Business Object, Column Name, and Column Value fields as appropriate. Most email functionality that uses SMTP Setup accounts will look for an SMTP Setup with ‘Business Object’ set to ‘SystemUser’, ‘Column Name’ set to ‘User_Name’, and ‘Column Value’ set to the currently signed-in system user. For example, if a system user called ‘sa’ sends an email from Sales Document Entry, SalesPad would use the following SMTP Setup if it existed:

When finished creating or editing the SMTP Setup, click the ‘OK’ button to save it.

Usage

Once configured, sending email via OAuth works very similarly to sending email via basic authentication. If SalesPad already has an access token, nothing will be different about sending email from Sales Document Entry, sending email via smart printing, sending email via Automation Agent, and so on. If you signed in to Microsoft or Google as part of configuring an SMTP account, SalesPad will already have an access token.

If SalesPad does not have an access token or something revoked the token, the next time a user tries to send an email with that SMTP configuration, SalesPad will ask the user to sign in to Microsoft or Google. The user must sign in with the SMTP account which was previously entered into the ‘SMTP User’ setting or SMTP Setup field. The sign-in will default to that account, but if the user selects a different account the email may fail to send with an error and SalesPad will ask that user to sign in again next time.

If the setting ‘Can Sign In When Sending Email’ is set to ‘False’, users will get an error message when trying to send an email without an access token instead of a sign-in screen. In this situation, users must go to the screen where their SMTP configuration is to sign in. For Sales Email Confirmation, the sign-in button is the ellipses button on the ‘SMTP User’ setting. For SMTP Setup, edit the SMTP Setup you want to sign in to and click the ‘Sign In’ button.

Likewise, the Automation Agent Service cannot ask a user to sign in when necessary regardless of that setting’s value. If Automation Agent gives errors such as “Failed to obtain an access token”, an administrator must sign in to Microsoft or Google via Sales Email Confirmation settings or SMTP Setup. Once signed in, Automation Agent can send emails via OAuth seamlessly.

Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Paul Manyen

  2. Posted

Comments