Troubleshooting System Email

If you encounter errors or issues while sending email to your clients or configuring your mail provider, see the sections below to start troubleshooting and resolve the issue.

General Email Issues

You may encounter the following common issues:


Error or IssueCauseNext Steps
Data Not AcceptedThe mail server rejected email. This can occur for many reasons.Data Not Accepted Errors
External systems are flagging your WHMCS installation’s emails as spam or rejecting them.Usually, this is due to the server configuration.Email Flagged as Spam
TypeError: array_search(): Argument #2 ($haystack) must be of type array, null given in /path/to/whmcs/vendor/whmcs/whmcs-foundation/lib/Cron/Task/EmailMarketer.php:0An invalid value in the Email Marketer rule (a missing billing cycle) causes an error in PHP 8.1 environments only.Email Marketer TypeErrors
You see a syntax error when troubleshooting email-related issues.Syntax errors are usually due to invalid code in the email template.Email Template Syntax Errors

Sending Failures

You may encounter the following common issues that prevent mail from sending:


Error or IssueCauseNext Steps
Message Body EmptyA syntax error occurred, preventing the email from sending.Message Body Empty Errors
No recipients provided for messageThe client has opted out of receiving this type of email in their Email Notification preferences.No Recipients Errors
Sending Failed. Please see documentation.The API command cannot send the specified email template type for the messagename parameter.SendEmail Sending Failure
Sender Verify FailedThis error indicates that the sending email address is invalid or does not exist on the SMTP server.Sender Verify Failed Errors
Email Send Aborted By HookThis error indicates that a custom hook has prevented the email from sending.Sending Aborted by Hook
Email sending aborted by configurationYou have set Disable Email Sending to ON.Sending Aborted Configuration
Email sending aborted.An unknown issue has prevented the email from sending.Sending Aborted Errors
Smarty Error: Not allowed by security policyThe email template contains advanced code that the default email security policy blocks.Smarty Policy Errors
Admins receive an email from the WHMCS system with two To email headers, one of which is to undisclosed-recipients.The email is addressed to the same admin email address in both the To and BCC fields.Undisclosed Recipients
The system is not successfully sending general emails, like client sign-up or order confirmations.This issue is usually due to a misconfiguration.Unsent General Emails
The system isn’t sending support ticket notification emails to your staff (for example, new support tickets or new client replies).This issue is usually due to a misconfiguration.Unsent Ticket Notifications
The system is not sending product welcome emails.This is usually due to a problem with account creation, or you may not have configured a welcome email.Unsent Welcome Emails

You may see certain common issues related to your system mail provider:

Microsoft®

You may encounter the following common issues with Microsoft:


Error or IssueCauseNext Steps
Connection unsuccessful. Please close this window and try again.The Application (client) ID and Client Secret combination for your Microsoft Entra® ID (formerly Microsoft Azure®) app are invalid.Microsoft Connection Failures
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 Mail Query Errors
SMTP ERROR: Password command failed: 535 5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled for the Tenant. Visit https://aka.ms/smtp_auth_disabled for more information.Microsoft® removed support for basic (username and password-based) SMTP authentication in June 2024.SMTP Password Command Failed Errors

PHP Mail

You may encounter the following common issues:


Error or IssueCauseNext Steps
Could not instantiate mail functionThe mail server rejected the system’s attempt to send mail.Could Not Instantiate Errors
Call to undefined function PHPMailer/
HPMailer/scapeshellarg() in /path/to/whmcs/vendor/phpmailer/phpmailer/src/PHPMailer.php:1730The escapeshellarg function is disabled in your server’s PHP configuration.Undefined PHPMailer Function Errors

SMTP

You can begin the troubleshooting process for many SMTP-related issues by enabling Debugging for your mail provider in the Mail tab at Configuration () > System Settings > General Settings (or, in WHMCS 8.5 and earlier, SMTP Debug).

You can also enable SMTP debugging by adding $smtp_debug = true to your configuration.php file.

You may encounter the following common issues with SMTP:


Error or IssueCauseNext Steps
Sender Verify FailedThis error indicates that the sending email address is invalid or does not exist on the SMTP server.Sender Verify Failed Errors
Could Not AuthenticateThe mail server is rejecting the SMTP details that you entered for Mail Provider.SMTP Authentication Errors
Could not connect to SMTP host or SMTP connect() failed.There are several possible reasons for this error.SMTP Connection Errors
SMTP ERROR: Password command failed: 535 5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled for the Tenant. Visit https://aka.ms/smtp_auth_disabled for more information.Microsoft® removed support for basic (username and password-based) SMTP authentication in June 2024.SMTP Password Command Failed Errors

Support Tickets

For issues with email piping, email importing, or other support ticket-related email, see Troubleshooting the Support System.

Renewal Notices and Payment Reminders

You may encounter the following common issues:


Error or IssueCauseNext Steps
The domain renewal link in domain renewal reminder emails is broken.The system generated the URL incorrectly.Broken Renewal Links in Emails
Message Body EmptyA syntax error occurred, preventing the email from sending.Message Body Empty Errors
The system does not send payment reminder emails.There is an issue with your reminder settings or a missing email template.Missing Payment Reminders

Email Templates

You may encounter the following common issues:


Error or IssueCauseNext Steps
You see a syntax error when troubleshooting email-related issues.Syntax errors are usually due to invalid code in the email template.Email Template Syntax Errors
The system does not send payment reminder emails.There is an issue with your reminder settings or a missing email template.Missing Payment Reminders
Sending Failed. Please see documentation.The API command cannot send the specified email template type for the messagename parameter.SendEmail Sending Failure
Smarty Error: Not allowed by security policyThe email template contains advanced code that the default email security policy blocks.Smarty Policy Errors
The system is not successfully sending general emails, like client sign-up or order confirmations.This issue is usually due to a misconfiguration.Unsent General Emails

Last modified: January 28, 2025