InMotion Hosting Support Center

In the PrestaShop 1.5 back office, you have the ability to send email via either the php mail() function or SMTP. It is the most common to use the php mail() function. When using this setting, you may receive an error like the one below:

Sending failed using mail() as PHP's default mail() function returned boolean FALSE

This error occurs because of a false return code for the following statement in the MailSend.php.

if (!ini_get("safe_mode")) $success = mail($to, $subject, $message, $headers, $params); else $success = mail($to, $subject, $message, $headers);

The first thing you want to check is to see if the mail() function is enabled on your server. This can be easily checked by using a phpinfo page. If the mail function is disabled, it will display in the disable_functions label as shown here.

php info description

If the mail function is enabled, then you may need to follow the steps below to fix the issue and allow your site to send mail. Follow the guide below as we show you how to fix the "Sending failed using mail() as PHP's default mail() function returned boolean FALSE" error in PrestaShop 1.5.

Fixing the ability to use the mail function in PrestaShop 1.5

  1. First, log into your cPanel dashboard.
  2. From the main cPanel, navigate to the root folder for your PrestaShop application by using the File Manager.
  3. Once in the root folder, you will need to make three code changes in three files. The first is located in the /tools/swift/Swift/Plugin/MailSend.php at around line 158.

    $headers = $headers->build();

    $headers = $headers->build();
    $params = "";
  4. Next, navigate to the /tools/swift/Swift/Message.php file to around line 79.


  5. Finally, navigate and change the /tools/swift/Swift.php file at around line 370.

    if (!($has_reply_to = $message->getReplyTo())) $message->setReplyTo($from);

    if (!($has_reply_to = $message->getReplyTo())) $message->setReplyTo($from);
    if (!$has_reply_to[0]) $message->setReplyTo($from->getAddress());
  6. Ensure you save each of the edited files in order to activate the changes. Your PrestaShop 1.5 site should now be able to send email. Special thanks from Sales Mechanics in the forums for this fix!
Continued Education in Course Prestashop 1.5
You are viewing Section 8: 349: Unable to use php mail function in PrestaShop 1.5
Section 7: 350: How to fix the fopen and magicquotes error in Prestashop
Section 9: 333: Configuring the Product Comments module in PrestaShop 1.5

Support Center Login

Our Login page has moved, Click the button below to be taken to the login page.

Social Media Login

Social Login Joomla

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question
n/a Points
2016-06-23 2:34 pm


YAY this worked perfectly THANK you.

I am using Prestashop

n/a Points
2016-03-24 11:00 am

Many thanks, it is working!!!

n/a Points
2015-05-14 10:31 am

SWEET!!! this worked fine for me thanks =-)

n/a Points
2014-11-19 11:05 pm
This fix works for prestashop as well , i had same issue and your post help me to fix my mail sending problem, thank you very much!!
n/a Points
2014-08-19 4:55 pm
This article is great. I followed the steps and it solved the issue. Thanks a lot!!
n/a Points
2014-08-10 3:23 am

Not working for me :(


30,497 Points
2014-08-11 11:04 am
Hello Bianchery,

Thank you for your comment. We are happy to help, but will need some additional information. What happens when you try to send mail. Are you getting any errors? What are they?

Turning on Error reporting in PrestaShop may help provide a more detailed error.

Are the emails being returned/bounced?

If you have any further questions, feel free to post them below.
Thank you,

n/a Points
2014-08-15 10:08 am

Hello John,


Thank you very much for the help. This problem little bit mistery for me. My Prestashop run more than 1 years ago without any problems. I use Prestahop

Few weeks ago happened when change the status in one order for shipped, the system show the error message: have a problem with the mail. The costumer don't get any mail.


I went to "Advanced parameters > Email" and try to send test email. Didn't works.


I got this message:

"Error: please check your configurationSending failed using mail() as PHP's default mail() function returned boolean FALSE."

After is found this topic, changing every php files, but still unable sending email.

43,761 Points
2014-08-15 11:15 am
Hello Bianchery,

I am unsure if you are one of our customers so I cannot check into your server. Did you follow the same instructions above and still get the error? Have you also tested the mail() functionality separate from the PrestaShop?

Your host may also be able to provide more information on whether mail() is working for your server/account.

Kindest Regards,
Scott M
n/a Points
2014-08-15 10:17 am

I turned on Error reporting in Prestashop but I don't get any message on a display. Where can I check the logfile? Maybe useful.

n/a Points
2014-07-16 1:00 am
This is good

Post a Comment

Email Address:
Phone Number:

Please note: Your name and comment will be displayed, but we will not show your email address.

11 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?


Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail:
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!