Email importing is distinct from email piping and requires a different configuration. We recommend using email importing instead of email piping if you use any control panel other than cPanel or if you want to import email from multiple domains.
In WHMCS 8.1 and later, the system sends support emails with RFC 3834-compliant headers by default.
- You can disable this at Configuration () > System Settings > General Settings in the Mail tab.
- Regardless of your settings, WHMCS will not accept email that contains the Auto-Submitted header via email piping or email importing.
Email Importing with OAuth
WHMCS 8.1 and higher introduces support for email importing using OAuth with Gmail. OAuth provides access to your mail provider, and is more secure than traditional username-and-password authentication. Some mail providers are requiring OAuth, or have announced a requirement for it in the future.
To use OAuth for Gmail with WHMCS, you will need to both configure Gmail as your mail service provider and create an app for it in the Google Cloud console. For more information, see Setting Up POP3 Importing with OAuth via Google.
Configuring Email Importing
To configure email importing for a support department:
- Set up your email accounts:
- For email importing with OAuth, configure Gmail as your mail service provider and create an app for it in the Google Cloud console. For help with this step, see our Setting Up Email Importing with OAuth via Google documentation.
- For non-OAuth email importing, create a unique email account on your mail server for each support department. This must be a full inbox; an alias is not sufficient.
- In WHMCS, navigate to Configuration () > System Settings > Support Departments.
- Create a new department and enter the top section of information or, for existing departments, click Edit.
- Enter the email information for the department.
- Select a Service Provider. If you want to use OAuth via Gmail, select Google. Otherwise, select POP3/IMAP.
- Enter a Hostname, or, if you selected Google, make sure that pop.gmail.com is already set.
- Enter a Mail Server Port. Usually, this is 995.
- Select your Authentication type. If you want to use OAuth via Gmail, select OAuth2. Otherwise, select Password.
- Fill out the remainder of the form:
- If you selected Password as your Authentication type, enter the email address and password for the email account that you created.
- If you selected OAuth2 as your Authentication type, enter your Email Address and the ClientID and Client Secret that you generated through Google. Then, click Connect.
- Set up a cron job to run the pop.php file using the Ticket Importing using Mail Importing (POP3/IMAP) command on the Support Departments page every few minutes. We recommend that you set this to run every five minutes.
The system will delete email in the source mailboxes upon successful import into WHMCS.