This tutorial shows how to fix “Could not instantiate mail function” error in Joomla.
This is the most common error message if there are any issues sending emails via Joomla. Most likely it appears if your Joomla server does not support php mail() function, though Joomla attempts to send an email. Error message itself does not define the actual reason; there might be several ways to have it resolved. They depend on the server used – either local or live. Let’s check them one by one.
WAMP, XAMP, MAMP or any other local server might be used for Joomla installation. If the template is installed over one of those, emails won’t be sent, as local hosts don’t have mail server. In this case AcyMailing should be configured manually to use external SMTP server settings instead. However, it might be not working after uploading the site to the live host.
When Joomla is installed over the live server, the same ‘Could not instantiate mail function’ error sometimes appears when sending mails. First, make sure that SMPT settings are properly configured. Navigate to Site -> Global Configuration -> Server -> Mail Settings. All the fields should be filled in there:
There might be a few reasons to check:
AcyMailing settings are invalid. Make sure to use correct data under the Components -> AcyMailing -> Configuration -> Mail Configuration section of Joomla admin panel.
Receiver email address can be not valid. In this case, ‘Could not instantiate mail function’ error appears for several subscribers only. It means the message can’t be delivered to the mentioned email address. Subscriber should verify the email address itself.
Special characters in the subject of email. Some servers refuse delivering emails if they contain special characters in the ‘Subject’ field. Make sure to avoid using those. Alternatively, contact your hosting provider for more details and configuration.
Subject line is too long. You won’t be authorized to deliver messages if the subject is too long. It happens due to the server email requirements.
Limit of sent emails is exceeded. Some servers have a limit of emails sent per hour. If the one is exceeded, the server refuses delivering new emails. This means you should wait some time to have an ability sending more ones.
As you can see, most likely this error appears due to the server settings. Therefore, you should contact the hosting provider directly to set up and configure new email account properly. This saves your time to define and resolve the actual reason of the ‘Could not instantiate mail function’ matter.