Issues

How To Deal With Sending Tests With Error “Could not instantiate mail function”

By April 11, 2017 No Comments

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 a 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 Newsletter, it means your blog won’t be able to send any email. It’s not a problem of Newsletter, is a system wide block.

There are 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 and higher price to access that function. But it is vital: WordPress sends a number of notification 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 in sending emails. You should be sure they at least are paying attention to not be black listed, otherwise you’ll start to send unreliable emails that will be dropped or move to the spam folder.

Ask the provider for an SMTP

Few provider prefer to give an SMTP to who needs 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 and external mail provider

There are many mail delivery service, most of them with a free plan for a limited number of emails per month. Examples are Sendgrid, Mailgun, Mailjet, Sparkpost, 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 even 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 and 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. Newsletter 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.