Set Up Email Importing - Google

WHMCS can import email through several different service providers, including POP3 or IMAP, Google®, and Microsoft®. Google and Microsoft include the benefits of OAuth2, which provides more security than traditional username-and-password authentication.

Email piping and email importing use separate configurations and are distinct methods of importing email replies. If you want to use email piping, see Set Up Email Piping with Google.

Set Up Email Importing with Google

To set up email importing using Google, you will need to configure a Google Cloud® console app, create a client ID, and then set up Gmail™ in WHMCS.

1. Create Your Google Application

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.

To create a Google Application:

  1. Go to the Google Cloud console. If you haven’t before, select your country and agree to Google’s Terms of Service.
  2. Go to APIs and Services > Credentials.
  3. In the top-right corner, click Create Project. Enter a Project Name and choose a Location. Then, click Create.
    Enter a project name and location.
  4. Click Create Credentials and select OAuth client ID.
  5. Click Configure Consent Screen.
  6. Select External for User Type, and then click Create. This indicates that anyone can use the generated client ID after a verification process. However, when creating a client ID that’s only for use with WHMCS, you do not need verification.
    Select the External user type.
  7. Enter the information on the OAuth consent screen. Use the default Scopes, and make sure to add your WHMCS domain to the list of Authorized domains.
    The OAuth consent screen
  8. Click Save.

2. Create the Client ID.

To create the client ID:

  1. In the Google Cloud console’s left sidebar, 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 Redirect URL from within WHMCS.
  7. Click Create. A confirmation message will appear, with the Client ID and Client Secret to use in the steps below.

3. Set up Gmail in WHMCS

To set up importing with Gmail:

  1. Go to Configuration () > System Settings > Support Departments.
  2. Enter your support department information in the Add New Department section of the page or click Edit for an existing department.
  3. Under Mail Importing Configuration, select Google for Service Provider. The system will automatically set the Hostname to pop.gmail.com.
    Configuring Google for importing
  4. Select OAuth2 for Authentication. Several text boxes will appear.
  5. For Email Address, enter the Gmail address that you used in your application.
  6. Copy-and-paste the Client ID and Client Secret from the Google Cloud Console into the appropriate boxes. These will display in the confirmation message, or you can go to Credentials and click the edit icon for the appropriate OAuth 2.0 Client IDs.
    The Client ID in Google
    The Client ID in Google
  7. In WHMCS, next to Connection Token, click Connect. (There should not be a value in Connection Token yet.)
    Click Connect
  8. In the Google Choose an account screen that appears, select the account that you used to create the app.
  9. 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.
    • When you finish this, WHMCS will automatically enter a token in Connection Token.
  10. Click Save. The system will test your configuration again when you save, and then you will be ready to start using email importing.

Last modified: June 14, 2024