contact_mailContact Form 7codePHPerrorerrordescriptioncontact-form-7mailMailsettingsserver_configurationlabelCommonwarningModerate

Contact Form 7: Mail (2) sending failed: PHP mail() function disabled

Contact Form 7 reports a failure for Mail (2) when the PHP mail function is not available. The plugin relies on WordPress’s wp_mail wrapper, which ultimately calls PHP’s mail().

When the server disables mail(), the call returns false. WordPress records the error and displays the message in the admin screen. No email is sent to the recipient or the site administrator.

The issue originates from the server environment, not from the form fields or shortcode. Shared hosting panels often turn off mail() for security reasons. Some hosts list mail in the disable_functions directive or omit a valid sendmail_path.

Other WordPress features using wp_mail, such as password reset emails, also stop working. The problem appears in the debug log as a PHP warning about mail() being disabled.

Symptoms

[dashicons-warning]
Error message in CF7 admin
Admin screen shows “Mail (2) sending failed: PHP mail() function disabled”.
[dashicons-email]
No email received
Form submission shows thank you message but inbox receives nothing.

Common Causes

PHP mail() disabled by host
Hosting panel disables the function in php.ini or via security policy.
disable_functions includes mail
php.ini lists mail in disable_functions, preventing execution.
Missing sendmail_path
Invalid or absent path to sendmail binary makes mail() unusable.
ModSecurity blocks outbound mail
Web application firewall flags mail() calls as potential spam.
Need this fixed right now?

Don't waste your day debugging. Our experts can Fix your issues in under 2 hours.*

Success Rate

100% Guaranteed

Starting from

$35 /hour
99+

Trusted by Business Owners

“I spent 3 days trying to fix the Elementor loading loop. These guys fixed it in 20 minutes. Lifesavers!”

— Sarah J., Web Designer

Related Issues

contact_mail
Contact Form 7: REST API request failed: 503 Service Unavailable
A 503 Service Unavailable response stops Contact Form 7 from sending data...
apiREST APIerror503descriptioncontact-form-7
contact_mail
Contact Form 7: REST API request failed: 429 Too Many Requests

The form tries to send data through the WordPress REST API. The...

apiREST APIerrorerrorsecurityfirewalldescriptioncontact-form-7settingsserver_configuration
contact_mail
Contact Form 7: REST API request failed: 401 Unauthorized

The form tries to send data via the WordPress REST API. The...

apiREST APIadmin_panel_settingspermissionsdescriptioncontact-form-7lock401
contact_mail
Contact Form 7: File upload error: temporary directory missing

The error appears when Contact Form 7 cannot locate a writable temporary...

codePHPcloud_offupload erroradmin_panel_settingspermissionsdescriptiontemporary filedescriptioncontact-form-7
contact_mail
Contact Form 7: Mail (2) sending failed: PHP mail() function disabled

Contact Form 7 reports a failure for Mail (2) when the PHP...

codePHPerrorerrordescriptioncontact-form-7mailMailsettingsserver_configuration
contact_mail
Contact Form 7: Mail (2) sending failed: SSL certificate verification failed

Contact Form 7 reports a failure when trying to send the secondary...

errorerrorlocksslcodecURLdescriptioncontact-form-7