JOOMLA
How to Fix PHPMAILER_RECIPIENTS_FAILED Error in Joomla Forms
Learn how to fix the PHPMAILER_RECIPIENTS_FAILED error when trying to submit a form on your Joomla site, either by editing the code or adjusting email settings in Joomla administration.
If you are facing the PHPMAILER_RECIPIENTS_FAILED error when trying to submit a form in Joomla, follow these steps to fix it. The error usually occurs in older versions of Joomla, such as 1.5, due to issues with the authentication header and email sending.
Step 1: Locate the File on the Server
Navigate to the controller.php file at the following path on your hosting server:
components/com_contact/controller.php
Step 2: Edit the File
Open the controller.php file and find line 162, where you will see the code:
$mail->setSender( array( $email, $name ) );
Replace that line with the following code:
$mail->setSender( array( $MailFrom, $name ) );
$mail->addReplyTo( array( $email, $name ) );
This code change helps fix the issue related to the authentication header and email sending.
Step 3: Configure Joomla (If Necessary)
If you face difficulties editing files or prefer a simpler solution, you can change the default sending configuration in the Joomla administration panel. Follow these steps:
-
Access the Joomla administration.
-
Go to the “Site” menu and select “Global Configuration”.
-
In the “Server” tab, go to “Mail Settings”.
-
In the “Mailer” field, replace “SMTP” with “PHP Mail” (without quotes).
-
Save the settings.
Depending on your hosting, additional settings may be required for sending emails using the “PHP Mail” method. If the above solution does not work immediately, contact your hosting support for further guidance.
Revisited in November 2026
Rereading it, I noticed the file path had gone missing from step 1. It was in the original 2015 post and is back:
components/com_contact/controller.php.
It’s also worth explaining better why the change works. The contact form used the visitor’s e-mail as the sender.
When the sending server requires authentication, it refuses messages that claim to come from an address that doesn’t
belong to the authenticated account. The fix puts the site’s own e-mail as the sender ($MailFrom) and the visitor’s
in “reply-to”, so replies still reach whoever wrote. Today, with SPF and DMARC adopted by the big e-mail providers,
sending a message on behalf of another domain fails even more. The idea behind the fix applies to any form, on any
platform.
Joomla 1.5 lost support in 2012. In current versions this file no longer exists in this form, and the safe route is to configure authenticated SMTP sending in the Global Configuration, with the site’s e-mail as the sender. Switching to “PHP Mail”, which I suggested in step 3, depends on the hosting and, with today’s rules, tends to send the message to spam.
Who writes this
Eduardo Lira
Software developer in Rio de Janeiro. I started this blog in 2012, in technical support at a hosting company, writing down the fixes for the problems that came up every day. Today I work at Sofis Tecnologia, on critical healthcare systems and SQL Server database migrations.