Use Google for System Mail

You can choose from several supported mail providers to handle mail for your WHMCS installation. To configure Google, you will need to create an app in the Google Cloud console and configure SMTP as your mail provider.

Your mail provider configuration is separate from any email piping or importing that you configure for your support departments. For more information, see Email Piping and Email Importing.

Set Up Google as your Mail Provider

To configure the mail provider:

  1. In the Admin Area, go to the Mail tab at Configuration () > System Settings > General Settings.
    The Mail tab in General Settings
  2. Next to Mail Provider, click Configure Mail Provider.
    Configure Mail Provider in the Mail tab
  3. Select SMTP for Mail Provider.
    Mail Provider settings for Google in the Mail tab
  4. Select a value for Mail Encoding.
  5. Select Google for Service Provider.
  6. Enter smtp.gmail.com for SMTP Host and 465 for SMTP Port.
    The SMTP Host, SMTP Port, and SMTP Authentication settings
  7. Select Oauth2 for SMTP Authentication.
  8. For SMTP Username, enter the Gmail™ address that you will be using in your application.
    For steps to generate the Client ID and Client Secret in Google, see the Create your Google Application section below.
  9. Copy the Client ID and Client Secret values from the Google Cloud Console into the appropriate boxes in the confirmation message:
    Client IDs in Google You can also edit them by going to **Credentials **and clicking the edit icon for the appropriate OAuth 2.0 Client IDs row:
    Client IDs in Google
  10. Next to Connection Token, click Connect. (Connection Token will be empty.)
  11. Under Choose an account, select the account that you used to create the app.
  12. Follow the prompts to approve access for your account.
    If you see a This app isn’t verified. error, click Advanced and then click Go to at the bottom of the window.
    The system will automatically enter a token in Connection Token.
  13. To ensure that your configuration works, click Test Configuration.
  14. Click Save. The system will test your configuration again when you save.

Create your Google Application

Before you can set up Google as your service provider, you will need to create an app and then create an associated client ID. This will let you connect to Google via WHMCS.

If you have already used Google Cloud’s console, you may not need to perform some of these steps, or interfaces may not look like the screenshots below.

Create the App

To create the Google app:

  1. Log in to the Google Cloud console. If you haven’t before, select your country and agree to Google’s Terms of Service.
  2. In the left-side menu, go to APIs and Services > Credentials.
  3. Click Create Credentials and select OAuth client ID.
  4. Click Configure Consent Screen.
    Creating an OAuth client ID
  5. Select External for User Type.
    Choosing a User Type
    Selecting this allows anyone to use the generated client ID after a verification process. However, when creating a client ID that is only for WHMCS, you do not need verification.
  6. Click Create.
  7. Enter a new name in App name.
  8. Select an address for User support email.
  9. Click Add Domain and enter the domain for your WHMCS installation.
    Adding a domain
  10. Click Save and Continue.
  11. Click Add or Remove Scopes and add the following scopes:
  • userinfo.email
  • userinfo.profile
  • openid
  1. Click Save and Continue.
  2. For Test users, click Save and Continue without making any changes.

Create the Client ID

To create the client ID:

  1. In the left-side menu, click Credentials.
  2. Click Create Credentials and select OAuth client ID again.
  3. For the Application Type, select Web Application.
  4. Enter a name for your application.
  5. Under Authorized redirect URIs, click Add URI.
  6. Enter the Callback URL that displays in WHMCS.
    The Callback URL in WHMCS
  7. Click Create. A confirmation message will appear, with the Client ID and Client Secret to use in the steps above.
    The Client ID and Secret

Last modified: June 14, 2024