Fatal error: Uncaught exception ‘phpmailerException’ with message ‘Could not instantiate mail function.’

This error is caused by one of the following reasons:

  • Your host is blocking the email being sent
  • Your server is not configured to send email via the PHP mail() function

See below for solutions.

Your host is blocking the email being sent

Some hosts may block emails under certain circumstances, the most common reason is that the “From” address of the email is not set to an email address that is associated with your hosting account. You can try changing the $config['from'] setting in process.php so that it’s set to an address that has the same domain name as the website with the form. If this still does not work, you can set the form up to send via a SMTP server. See the page Sending emails via an SMTP server.

Your server is not configured to send email via the PHP mail() function

You should contact your hosting company and ask them to set this up on your server. If this is not a possibility, you can set the form up to send via a SMTP server. See the page Sending emails via an SMTP server.

Still having trouble? Head over to the forums.

Forums