Email Importing
Email importing retrieves support ticket email replies for your support ticket system. It can import email from multiple domains.
- Email piping and email importing use separate configurations and are distinct methods of retrieving email replies.
- We recommend using email piping if you use cPanel & WHM and only receive email replies from one domain.
- We recommend using email importing if you use other control panels or if you want to import email from multiple domains.
- Your mail service provider is separate from your configuration for email importing. You can update this configuration at Configuration () > System Settings > General Settings in the Mail tab.
Service Providers
WHMCS can import email through several different service providers, including POP3 or IMAP, Google, and Microsoft®. If you use WHMCS’s Google or Microsoft integrations, you can get the full benefit of those services’ additional features, including OAuth2, which provides more security than traditional username-and-password authentication.
- Microsoft email services are available in WHMCS 8.6 and later and support all Microsoft Entra® ID (formerly Microsoft Azure®) compatible email services.
- Google supports email via Gmail™.
Configuring Email Importing
To configure email importing for a support department, you must set up the support department’s email account and then add that information to your support department configuration.
To do this:
- Set up your email accounts:
- For POP3 or IMAP, create a unique email account on your mail server for each support department.This must be a mailbox; an alias is not sufficient.For steps to enable email importing with Gmail, see Set Up Email Importing.
- For OAuth 2 with Google or Microsoft, configure your mail service provider and create an app for it.
- For steps to enable Google, see Set Up Email Importing with Google.
- For steps to enable Microsoft, see Set Up Email Importing with Microsoft.
- For POP3 or IMAP, create a unique email account on your mail server for each support department.
- In WHMCS, go 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.
- Enter the appropriate details for your service provider.
- If you selected OAuth2 as your authentication type for Google, enter your email address and the ClientID and Client Secret values that you generated. Then, click Connect.
- Set up a cron job to run the
pop.php
file using the Ticket Importing using Mail Importing (POP3/IMAP) command that displays at Configuration () > System Settings > Support Departments.
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.
Security and OAuth2
OAuth is a technology that authorizes apps or services like WHMCS to access another service, such as a Gmail account. It’s more secure than traditional username-and-password authentication. In addition to its security benefits, some mail providers require OAuth or have announced a requirement for it in the future.
- WHMCS includes OAuth authentication support for email importing through Gmail in WHMCS 8.1 and later.
- To use OAuth for Gmail email with WHMCS, you will need to both configure Gmail as your mail service provider and create an app for it in the Gmail Cloud console.
RFC 3834
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.
Blocked Support Email Replies
WHMCS may block email replies to existing support tickets for several reasons:
- The sender is unregistered.
- The sender is not a
CC
recipient. - The sender is not associated with the support ticket’s client account.
As of WHMCS 8.3, blocking only occurs if you have disabled Allow Insecure Imports in the Support tab at Configuration () > System Settings > General Settings. If this setting is disabled and blocking does occur, you can still view these replies and add them to support tickets manually.
- For more information and steps to import these replies, see View and Import Blocked Replies.
- For steps to troubleshoot problems with email importing and a list of common errors and issues, see Troubleshooting the Support System.
- For additional help, contact your hosting provider or system administrator.
Troubleshooting
Error or Issue | Cause | Next Steps |
Argument 7 passed to processPoppedTicket() | This issue is due to the presence of a pop.php file from an older version of WHMCS. | Argument 7 Ticket Errors |
The system prevented an autoresponder from opening a ticket. (WHMCS 8.4 and later) or Prevented an Auto Responder from Opening a Ticket (WHMCS 8.3 and earlier) | An email ticket reply contained the Auto-Submitted attribute in its headers. | Auto-Submitted Header Errors |
Error: cannot connect to host ; error = stream_socket_client(): unable to connect to tls://mail.example.com:143 (php_network_getaddresses: getaddrinfo failed: Name or service not known) (errno = 0 ) | There is an invalid or unreachable Hostname value in the support department’s mail importing configuration. | Cannot Connect to Host Errors |
Connection refused | The server’s firewall is blocking traffic to Google®. | Connection Refused Errors |
Department Not Found or Department Not Found. Exiting | The support department is a CC or BCC recipient. | Department Not Found Errors |
Email importing is importing the same email replies multiple times. | You have configured multiple support departments in WHMCS to use the same mailbox. | Duplicate Imported Replies |
The system blocked a potential email loop. (WHMCS 8.4 and later) or Blocked Potential Email Loop (WHMCS 8.3 and earlier) | WHMCS received a large number of emails from the same email address, indicating an auto-responder loop. | Email Loop Errors |
Can not authenticate to POP3 server or Logon failure: unknown user name or bad password or Password command failed or Too many login failures | You entered an invalid username or password, your mailserver has blocked (blacklisted) you, or you are using an authentication method that your POP mailbox does not support. | Logon Failure Errors |
The Mail Import test failed: cannot select INBOX, is this a valid transport? | The mail importing configuration is using the wrong port number. | Mail Import Test Failed Errors |
Connection unsuccessful. Please close this window and try again. | Your Microsoft Entra® ID app credentials are invalid. | Microsoft Connection Errors |
Failed to Create $app_name application. Error detail URL may not contain a query string. | Microsoft Entra apps do not support the redirect URI format in WHMCS if you have set Friendly URLs to Basic URLs. | Microsoft Import Query Errors |
WHMCS Pop Cron Did Not Run | You have configured POP3 details for a support department but the cron job does not run successfully. | POP3 Cron Not Running |
One or more POP3 connections failed or Error: read failed - connection closed? | WHMCS cannot connect to the support department mailbox. | POP3 Read Failed Errors |
You experience timezone-related issues in WHMCS or while running WHMCS automation. | There is a timezone misconfiguration or a mismatch between the webserver’s PHP configuration and the cron engine’s PHP configuration. | System Timezone Issues |
TypeError: Return value of WHMCS\File::guessFileExtension() must be of the type string, null returned in /path/to/whmcs/vendor/whmcs/whmcs-foundation/lib/File.php | The fileinfo function is missing or disabled in your server’s PHP configuration. | TypeError guessFileExtension Errors |
Unable to communicate with the WHMCS installation | The cron.php , pop.php , or pipe.php files cannot communicate with the WHMCS installation. | Unable to Communicate Errors |
The sender's email address is not registered. (WHMCS 8.4 and later) or Unregistered Email Address (WHMCS 8.3 and earlier) | You have chosen to only allow registered clients to open tickets in this department. | Unregistered Address Errors |
Last modified: January 13, 2025