Guides & TutorialsSupport ToolsEmail PipingSetting Up POP3 Importing with OAuth via Google

Setting Up POP3 Importing with OAuth via Google

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

You can configure Google for email importing in WHMCS 8.0 and later using a Google Cloud® console app. For more information on setting up other service providers, see Email Importing Integrations and Setting Up Importing Using Microsoft.

Create Your Google Application

To use Gmail as your service provider, you will need to create an app. This will let you connect to Gmail 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.

First, go to the Google Cloud console. If you haven't before, select your country and agree to Google's Terms of Service.

Go to APIs and Services > Credentials.

In the top-right corner, click Create Project. Enter a Project Name and choose a Location. Then, click Create.

Click Create Credentials and select OAuth client ID.

Click Configure Consent Screen.

Select External for User Type, and then click Create. It's important to note that this indicates that the generated client ID will be usable by anyone, but only after you go through a verification process. However, when creating a client ID that's only for use with WHMCS, you do not need verification.

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.

Click Save and your new app is complete.

You must also create the client ID itself. In the left sidebar, click Credentials. Click Create Credentials and select OAuth client ID again.

For the Application Type, select Web Application.

Enter a name for your application. Then, under Authorized redirect URIs, click Add URI.

In the box that appears, enter the Redirect URL from within WHMCS.

Click Create. A confirmation message will appear, with the Client ID and Client Secret to use in the steps above.

Set up Gmail in WHMCS

To set POP3 importing, go to Configuration > System Settings > Support Departments.

Enter your support department information in the Add New Department section of the page. Then, under Mail Importing Configuration, select Google as your Service Provider. The system will automatically set the Hostname as

Select OAuth2 for Authentication. Several text boxes will appear.

For Email Address, enter the Gmail address that you used in your application.

For instructions to generate the Client ID and Client Secret, refer to the Create your Google Application section above.

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:

In WHMCS, next to Connection Token, click Connect. (There should not be a value in Connection Token yet.)

In the Google Choose an account screen that appears, select the account that you used to create the app.

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.

Click Save. The system will test your configuration again when you save, and then you will be ready to start using email importing.