Guides & TutorialsTroubleshootingEmail TroubleshootingTroubleshooting Email Sending Problems

Troubleshooting Email Sending Problems

The steps below will troubleshoot issues in WHMCS 8.0 and higher. For help troubleshooting WHMCS 7.10 and lower, see Troubleshooting Email Sending Problems.

If your WHMCS installation isn't sending emails or they don't display properly:

  1. Go to Configuration > System Logs.
  2. Check the logs for any error messages that occurred at the time of email sending.

Common Email Sending Errors

Could not instantiate mail function

This error occurs when you have selected PHP Mail as your mail type for the Mail Provider setting. It indicates that, when attempting to send the email, the mailserver rejected it.

The PHP Mail function uses the server's mail()  function, which is not always reliable. It also doesn't generate a friendly error.

Switching to another Mail Provider in the Mail tab at Configuration > System Settings > General Settings is faster, safer method and would allow you to have more descriptive errors when an issue does occur. These other methods are also usually more reliable when sending emails.

You could also try the following alternative server-side configuration changes that might resolve PHP mail() issues:

  • Install a local mail server (for example, Postfix).
  • Ensure that your sendmail_path points at the sendmail binary (usually /usr/sbin/sendmail) in your php.ini file.

On Ubuntu or Debian servers, you may have multiple .ini files in /etc/php5/mods-available or other locations.

Could not connect to SMTP host

There are several possible reasons for this error:

  • The SMTP settings that you entered for Mail Provider in the Mail tab at Configuration > System Settings > General Settings are incorrect. Check with your system administrator to ensure that you entered the correct SMTP Port, SMTP Host, SMTP Username, SMTP Password, and SMTP SSL Type settings for your mail server.
  • You're using an inappropriate SMTP Port setting and have selected SMTP SSL Type. For example, selecting SSL and the port number 25 would cause this error. The most common port assignments for each SSL type are: 
    • None25 or 26
    • SSL465 or 587
    • TLS587
  • The mail server is blocking connections from the server that hosts your WHMCS installation.
  • The server that hosts your WHMCS installation is blocking outgoing connections to the mail server.

Work with your server administrator or hosting provider to resolve these issues.

Could Not Authenticate

This indicates that the mail server is rejecting the SMTP details that you entered for Mail Provider in the Mail tab at Configuration > System Settings > General Settings. Make sure that they are correct.

SMTP restrictions on cPanel & WHM servers will automatically reroute any SMTP traffic back to localhost (the server WHMCS is on). To prevent this problem, navigate to Home >> Security Center >> SMTP Restrictions in WHM and disable the option.

If you are using Google Mail, this could also be due to the security settings in your email account. For more information, see Suspicious access attempt blocking and Allow applications to access your account.

Sender Verify Failed

A Sender Verify Failed error indicates that the sending email address does not exist on the SMTP server.

To confirm this:

1. Log in to cPanel and navigate to Home >> Email >> Email Accounts.

2. Note the email accounts on this page:

3. In WHMCS, go to Configuration > System Settings > General Settings.

4. Verify that Email Address matches one of the email addresses that you saw in cPanel.

Syntax Error

Syntax errors are usually due to invalid code in the email template.

The error in Configuration > System Logs provides the following debugging information:

  1. The error.
  2. The line number of the invalid syntax within the email template.
  3. The code surrounding the error.

To resolve the error, go to Configuration > System Settings > Email Templates and click on the email template (in this example, the Client Signup Email template).

Review the code of the email template and correct any errors.

In this example, an erroneous {if} is in the email template. Removing it will correct the syntax.

Click Save Changes.

Smarty Error: Not allowed by security policy

A Smarty Security Policy Error indicates that the email template contains advanced code that the default email security policy blocks.

Review the code in the email to confirm what it's trying to send at Configuration > System Settings > Email Templates. Then, add an exception to the email security policy to allow the desired code.

For a more detailed explanation of the security policy and instructions for adding an exception, see  Smarty Security Policy.

Data Not Accepted

A Data Not Accepted error occurs when the mail server rejects the email.

  • There could be many reasons for this, and you may need to contact your mail server administrator.
  • For steps to get more verbose output from your mail server, see Email Sending Issues.

You may see the following common causes for this:

Mail server does not allow different sender addresses and usernames

Some servers require that the From email address is the same as the authenticated user.

To assess this:

1. Go to the Mail tab at Configuration > System Settings > General Settings.

2. Click Configure Mail Provider. A new window will display.

3. Find SMTP Username and note the current value.

SMTP Username

4. Close the Configure Mail Provider window.

5. Find System Emails From Email and note the current value.

System Emails From Email

6. Choose the General tab.

7. Find Email Address and note the current value.

Email Address

If the values are different, check with your email provider that the SMTP user can send emails with the System Emails From Email address as the sender.

If it cannot, adjust System Emails From Email to match SMTP Username.

The file size of your message is too large

If sending of email with attachments fails, try removing the attachment from the email template at Configuration > System Settings > Email Templates.

If the daily Database Backup is the only email encountering the error, deactivate Email Backup and use  FTP Backup or cPanel Backup.

The receiver might be blacklisted or blocked by the SMTP server

Check your server's spam filtering settings.

Email sending rate-limiting has been triggered on the SMTP server

This is the most likely cause if the Data Not Accepted error occurs intermittently with a range of different email messages.

Wait a few hours before sending further emails.

If an email succeeds without any other changes to the WHMCS settings and mail server configuration,  contact your mail server administrator to increase the email sending limits for the SMTP user.

Email sending aborted by configuration

In WHMCS 8.1, this error indicates that you have set Disable Email Sending to ON at Configuration > System Settings > General Settings in the Mail tab. The system will log this error every time that you enable or disable this setting.

We recommend that you only enable this setting when you are testing updates or customizations on a development installation or while troubleshooting. For more information, see Disabling Outgoing Mail.

SMTP connect () failed

The full error typically displays with a troubleshooting URL:

SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

This error is typically due to once of the following causes:

  • DNS failure — The server cannot resolve the supplied SMTP host.
  • Firewall block — A firewall rule is preventing the server connecting to the supplied SMTP host.
  • Remote SMTP Disabled — The server configuration may prevent the use of external SMTP servers.
  • SSL Certificate Misconfiguration — A certificate on the hostname certificate on the SMTP server may be expired.

To identify the specific cause, follow the advanced troubleshooting steps to enable verbose output of the SMTP connection.

No recipients provided for message

The client has opted out of receiving this type of email via their Email Notification preferences.

To receive this email, the corresponding Email Notification preference must be enabled for the user or one of the client's contacts.

In this example, attempting to send a Product Welcome Email would result in a No recipients provided for message error because Product Emails is unchecked in both the Profile and Contacts tab.

Client Profile Tab
Client Contacts tab

To resolve the error, check Product Emails in at least one location.