The error message “Could not instantiate mail function” comes from a piece of software called PHPMailer. It occurs when PHP’s native mail() function fails to start the mail process, usually due to a server configuration issue.
Most hosting providers discourage using PHP’s built-in mail() function because it is unreliable and often blocked for spam prevention. Instead, they recommend sending email through an authenticated SMTP server or external mail service.
This issue is not caused by WS Form.
This article explains common causes and how to fix them.
Set Up an SMTP Server
The most reliable way to send email from WordPress is to use an SMTP (Simple Mail Transfer Protocol) server instead of PHP’s built-in mail() function. SMTP uses authentication and secure connections, which improves deliverability and avoids the “Could not instantiate mail function” error.
Solution: Install an SMTP plugin. Then connect it to a trusted email provider. Most plugins include setup wizards that guide you through entering SMTP credentials and testing the connection.
Reputable SMTP providers include:
Once SMTP is configured, WS Form and other plugins that use WordPress’s email functions will automatically send mail through the new connection.
Invalid Email Address
Make sure your Send Email action settings are correct:
- Use valid
FromandToemail addresses. - The
Fromaddress should use a verified domain that matches your website or SMTP provider. - Avoid using the same email address for both
FromandTo.
By default, WS Form sends emails to:
#blog_admin_email– The Administration Email Address in WordPress > Settings > General#blog_name– The Site Title in WordPress > Settings > General
You can override these in the Send Email action.
SMTP Plugin Does Not Support Display Names
WS Form supports display names in email addresses (e.g., Joe Bloggs <joe.bloggs@emailtmp.com>), as allowed by RFC 2822.
However, some SMTP plugins do not support this format and may cause emails to fail.
Solution: Try clearing the Display Name settings in the Send Email action and try sending again.

Invalid Subject Line
Some mail servers reject subject lines with special characters or excessive length.
Best practices:
- Use only alphanumeric characters.
- Keep the subject between 10–60 characters.
Running a Local Server (e.g. WAMP)
Local development servers often do not have a mail server installed, so PHP cannot send emails.
Solution: Use an SMTP plugin with an external SMTP provider when developing locally.
SMTP Provider Quotas
Some SMTP providers impose daily or hourly send limits. If these are exceeded, email delivery will fail.
Solution: Log in to your SMTP provider’s dashboard to check your quota and usage statistics.
Plugin Conflict
Some plugins that modify email headers or behavior can cause conflicts.
Solution:
- Deactivate all plugins except WS Form.
- Test email sending.
- Reactivate plugins one at a time, testing after each.
Once you identify the conflicting plugin, check its settings or contact its support team for help. If possible, disable only its email-related functionality or replace it with an alternative.
Outdated or Incompatible PHP Version
Older PHP versions may be incompatible with newer WordPress or plugin code used for sending emails.
Solution: Make sure you’re using a supported PHP version (WordPress recommends PHP 8.1 or higher). You can check your version under Tools > Site Health > Info > Server.
Summary
This error usually means your server isn’t configured to send email using PHP. The most reliable solution is to install an SMTP plugin and configure it with a trusted email provider such as Gmail, SendGrid, Amazon SES, or Mailgun.
SMTP connections are authenticated, more secure, and provide better deliverability than PHP’s mail() function.
If the issue persists, contact your hosting provider to verify mail capabilities or request SMTP credentials.