Error: “Could not instantiate mail function”

This is a rather rare error since the vast majority of hosting providers leave you to use the mailing functionalities of PHP (which is the programming language used to code WordPress).

PHP provides the mail() function used by WordPress to send emails, but that function can be disabled. If you get the error “Could not instantiate mail function” when you run a test from the status panel of the Newsletter plugin, it means your blog won’t be able to send any emails. It’s not a problem with the Newsletter plugin, is a system-wide block.

There are a few solutions you can take into consideration.

Open a ticket to your provider

The most obvious is to ask the provider to unlock the mail function. They could have valid reasons to block it, or they may ask for and higher price to access that function. But it is vital: WordPress sends a number of notifications and without the mail function no one will be delivered.

A note of warning: if the provider decided to lock that function, probably its servers won’t be so good at sending emails. It would help if you were sure they at least are paying attention to not be blacklisted, otherwise, you’ll start to send unreliable emails that will be dropped or moved to the spam folder.

Ask the provider for an SMTP

Few providers prefer to give an SMTP to those who need to send emails. An SMTP, to be simple, is a set of parameters to set in Newsletter or in an SMTP enabling plugin (like Postman) so WordPress can send email using an external service and no more the basic mail function.

Use an external mail provider

There are many mail delivery services, most with a free plan for a limited number of emails per month. Examples are Sendgrid, Mailgun, Mailjet, Sparkpost, and ElasticEmail. You can signup for a free account with them, get their SMTP parameters, and set them in Newsletter or in an SMTP-enabling plugin (like Postman).

You should deeply test this solution since a provider locking out the mail() function could lock out connections to external services. To bypass possible blocks, try different protocols and different ports: every mail delivery service provides a number of combinations.

Use an external mail provider with API

Mail delivery providers offer even an API interface to access their services. This type of connection is rarely blocked by a hosting provider but you need a specific plugin implementing the delivery via API of the mail service of your choice. The Newsletter plugin has several extensions to use the API service of leading mail delivery providers. Those extensions do not only deliver emails but get back the bounce addresses and keep your list clean.