darkamarka Posted October 11, 2012 Share Posted October 11, 2012 I have upgraded prestashop from 1.2.5 to 1.4.6.2 and now PHP MAIL sending not working. I get this error: Sending failed using mail() as PHP's default mail() function returned boolean FALSE Please Help! How to fix this? Link to comment Share on other sites More sharing options...
Carolina Custom Designs Posted October 17, 2012 Share Posted October 17, 2012 I get this error: Sending failed using mail() as PHP's default mail() function returned boolean FALSE First check if PHPs mail function is working outside PrestaShop. Follow the documentation [1] to create a standalone file and upload it to your server to send an email to an address under your control. If it does not work, contact your hosting provider (use of PHP's native mail function may be limited in server settings). Otherwise post again. [1] http://php.net/manual/en/book.mail.php Hope that helps! Marty Shue Link to comment Share on other sites More sharing options...
Ukoo - Guillaume Posted November 19, 2012 Share Posted November 19, 2012 (edited) Hello, I have the same problem. I test the PHP mail fonction by running this script : <?php $Name = "Ukoo Guillaume"; //senders name $email = "[email protected]"; //senders e-mail adress $recipient = "[email protected]"; //recipient $mail_body = "PHP mail() fonctionne !"; //mail body $subject = "php mail"; //subject $header = "From: ". $Name . " <" . $email . ">\r\n"; //optional headerfields mail($recipient, $subject, $mail_body, $header); //mail command I receive this email, but not the mails send from PrestaShop... What's the next step to test ? Regards Edited November 19, 2012 by Ukoo - Guillaume (see edit history) Link to comment Share on other sites More sharing options...
kolo86 Posted November 21, 2012 Share Posted November 21, 2012 (edited) @Ukoo - Guillaume: I have this same problem like you, PHP mail() function send e-mail but prestashop say it return FALSE. Edited November 21, 2012 by kolo86 (see edit history) Link to comment Share on other sites More sharing options...
Ukoo - Guillaume Posted November 21, 2012 Share Posted November 21, 2012 @Ukoo - Guillaume: I have this same problem like you, PHP mail() function send e-mail but prestashop say it return FALSE. Hello, I solved my problem by editing PrestaShop Core files (http://www.webbax.ch/2011/11/16/installer-prestashop-chez-infomaniak/). My host is Infomaniak. 1 Link to comment Share on other sites More sharing options...
Sale Mechanics Posted January 6, 2013 Share Posted January 6, 2013 I'm referring to PS 1.5.3.1. I had the same problems. The fix described above didn't work for me. My server-settings caused problems due to an empty "From"-field (FYI: my shop is hosted with Hosteurope). It can be fixed changing these files: /tools/swift/Swift/Plugin/MailSend.php /tools/swift/Swift/Message.php /tools/swift/Swift.php /tools/swift/Swift/Plugin/MailSend.php (around line 158) Old: $headers = $headers->build(); New: $headers = $headers->build(); $params = ""; /tools/swift/Swift/Message.php (around line 79) Old: $this->setFrom(""); New: $this->setFrom("yourmail@yourdomain"); /tools/swift/Swift.php (around line 370) Old: if (!($has_reply_to = $message->getReplyTo())) $message->setReplyTo($from); New: if (!($has_reply_to = $message->getReplyTo())) $message->setReplyTo($from); if (!$has_reply_to[0]) $message->setReplyTo($from->getAddress()); 2 Link to comment Share on other sites More sharing options...
mohamadeffazuan Posted January 10, 2013 Share Posted January 10, 2013 Sale Mechanics, I follow your instruction but it doesn't work. I'm using PS 1.5.1.0 Link to comment Share on other sites More sharing options...
smile58 Posted February 19, 2013 Share Posted February 19, 2013 Sale Mechanics Thanks it works.... using 1.5.2.0 wow fantastic, I searched this solution 1 month Link to comment Share on other sites More sharing options...
smollema Posted February 19, 2013 Share Posted February 19, 2013 Cheers Sale Mechanics!, this also works for TRANSIP hosting. PS 1.5.3.1 Link to comment Share on other sites More sharing options...
Pressed0024 Posted March 4, 2013 Share Posted March 4, 2013 This works in 1.5.3.1 but I have a problem. The "From" is an email address and looks ugly when customer receives them. So i tried inserting "Some Name" but that doesn't work. Any ideas? : /tools/swift/Swift/Message.php (around line 79) New: $this->setFrom("yourmail@yourdomain", "Some Name"); Link to comment Share on other sites More sharing options...
sergio00 Posted March 24, 2013 Share Posted March 24, 2013 (edited) Sale Mechanics Works successfully in 1.5.3.1 !!! I tested severals codes but only works yours. Best Regards!!!!!!!!! Edited March 24, 2013 by sergio00 (see edit history) Link to comment Share on other sites More sharing options...
pmai Posted April 17, 2013 Share Posted April 17, 2013 sorry , i did config mail and modify 3 file , but when send mail not work . I use PS 1.5.3.1 , pls help me. Link to comment Share on other sites More sharing options...
pmai Posted May 6, 2013 Share Posted May 6, 2013 Cheers Sale Mechanics! I setup "PS 1.5.3.1" on Cloud Servers Rackspace , and I follow your instruction but it doesn't work . Pls help me. Thanks Link to comment Share on other sites More sharing options...
marlon Posted July 30, 2013 Share Posted July 30, 2013 SOS prestashop 1.5 no envia los correos intento hacer enviar un correo de prueba y me sale Error: Por favor compruebe su configuración Sending failed using mail() as PHP's default mail() function returned boolean FALSE. por favor ayuden Link to comment Share on other sites More sharing options...
vekia Posted July 30, 2013 Share Posted July 30, 2013 SOS prestashop 1.5 no envia los correos intento hacer enviar un correo de prueba y me sale Error: Por favor compruebe su configuración Sending failed using mail() as PHP's default mail() function returned boolean FALSE. por favor ayuden hello please describe your issue in english, not everyone here is fluent in spanish (we are in english section) i will be greatefull regards 1 Link to comment Share on other sites More sharing options...
pbf Posted August 18, 2013 Share Posted August 18, 2013 I'm referring to PS 1.5.3.1. I had the same problems. The fix described above didn't work for me. My server-settings caused problems due to an empty "From"-field (FYI: my shop is hosted with Hosteurope). It can be fixed changing these files: /tools/swift/Swift/Plugin/MailSend.php /tools/swift/Swift/Message.php /tools/swift/Swift.php /tools/swift/Swift/Plugin/MailSend.php (around line 158) Old: $headers = $headers->build(); New: $headers = $headers->build(); $params = ""; /tools/swift/Swift/Message.php (around line 79) Old: $this->setFrom(""); New: $this->setFrom("yourmail@yourdomain"); /tools/swift/Swift.php (around line 370) Old: if (!($has_reply_to = $message->getReplyTo())) $message->setReplyTo($from); New: if (!($has_reply_to = $message->getReplyTo())) $message->setReplyTo($from); if (!$has_reply_to[0]) $message->setReplyTo($from->getAddress()); it works ... thank you very much Link to comment Share on other sites More sharing options...
tihon Posted October 22, 2013 Share Posted October 22, 2013 It wors for me but in email instead Shop Name is email address. It is not very good. Link to comment Share on other sites More sharing options...
portugal Posted January 22, 2014 Share Posted January 22, 2014 A full day I'm trying to change just like this to describe it. I can't get in my prestashop 1.5.3.1 Please I'm about to finish my website I want to help as per work Sending failed using mail() as PHP's default mail() function returned boolean FALSE. /tools/swift/Swift/Plugin/MailSend.php /tools/swift/Swift/Message.php /tools/swift/Swift.php /tools/swift/Swift/Plugin/MailSend.php (around line 158)Old:$headers = $headers->build();New:$headers = $headers->build();$params = "";/tools/swift/Swift/Message.php (around line 79)Old: $this->setFrom("");New: $this->setFrom("yourmail@yourdomain");/tools/swift/Swift.php (around line 370)Old:if (!($has_reply_to = $message->getReplyTo())) $message->setReplyTo($from);New: if (!($has_reply_to = $message->getReplyTo())) $message->setReplyTo($from);if (!$has_reply_to[0]) $message->setReplyTo($from->getAddress()); Link to comment Share on other sites More sharing options...
Dykstran Posted March 31, 2014 Share Posted March 31, 2014 I have also the same problem described here, and I have tried the solution mentioned by "Sale Mechanics" by it does not work for me Does anyone know another solution please? The shop is useless without emails... Link to comment Share on other sites More sharing options...
Dykstran Posted March 31, 2014 Share Posted March 31, 2014 I finally fixed it configuring a "From" email address with the same domain that my webhosting... Link to comment Share on other sites More sharing options...
mohamedali Posted April 4, 2014 Share Posted April 4, 2014 its working... /tools/swift/Swift/Plugin/MailSend.php (around line 158)Old:$headers = $headers->build();New:$headers = $headers->build();$params = "";/tools/swift/Swift/Message.php (around line 79)Old: $this->setFrom("");New: $this->setFrom("yourmail@yourdomain"); thanks to all... Link to comment Share on other sites More sharing options...
provola Posted May 7, 2014 Share Posted May 7, 2014 Hi, Suddenly I am not any longer able to send email through Prestashop 1.5.6.1 When I try the test email button in Prestashop I get the error "Error: Please check your configuration Sending failed using mail() as PHP's default mail() function returned boolean FALSE." I modified the three files as suggested in this post, but it does not work. Any suggestion? Regards, Simone Link to comment Share on other sites More sharing options...
iknowsomethingcom Posted June 1, 2014 Share Posted June 1, 2014 Hi, Suddenly I am not any longer able to send email through Prestashop 1.5.6.1 When I try the test email button in Prestashop I get the error "Error: Please check your configuration Sending failed using mail() as PHP's default mail() function returned boolean FALSE." I modified the three files as suggested in this post, but it does not work. Any suggestion? Regards, Simone Look into ps_configuration table for duplicate entries of PS_SHOP_EMAIL and PS_SHOP_NAME. Remove duplicates and you should be OK. Link to comment Share on other sites More sharing options...
vekia Posted June 1, 2014 Share Posted June 1, 2014 Hi, Suddenly I am not any longer able to send email through Prestashop 1.5.6.1 When I try the test email button in Prestashop I get the error "Error: Please check your configuration Sending failed using mail() as PHP's default mail() function returned boolean FALSE." I modified the three files as suggested in this post, but it does not work. Any suggestion? Regards, Simone are you 100% sure that your host allows to use mail() function? it looks like not :/ Link to comment Share on other sites More sharing options...
iknowsomethingcom Posted June 1, 2014 Share Posted June 1, 2014 (edited) are you 100% sure that your host allows to use mail() function? it looks like not :/ Message "Error: Please check your configuration Sending failed using mail() as PHP's default mail() function returned boolean FALSE." doesn't mean mail() cannot be used because it already returned result (it means it works but has issue). I found that this issue comes from duplicate entries in ps_configuration of PS_SHOP_EMAIL. Probably the first (and bad) entry contains something like [email protected] and the second one your valid shop email. Another thing is to configure emails in Customers > Contacts (default values are also like [email protected]). If you correct these issues, you don't have to fiddle in the scripts as suggested in above posts. Edited June 1, 2014 by iknowsomethingcom (see edit history) Link to comment Share on other sites More sharing options...
provola Posted June 4, 2014 Share Posted June 4, 2014 Hi iknowsomething, Thank you for your advice. Actually, after my post, the next day the mail() function worked normally. I'll follow your suggestion if the problem occurs again. thanks, Link to comment Share on other sites More sharing options...
jbrathod1312 Posted July 24, 2014 Share Posted July 24, 2014 Sale Mechanics Thanks it works.... using 1.5. A full day I'm trying to change just like this to describe it. I can't get in my prestashop 1.5.3.1 Please I'm about to finish my website I want to help as per work Sending failed using mail() as PHP's default mail() function returned boolean FALSE. /tools/swift/Swift/Plugin/MailSend.php /tools/swift/Swift/Message.php /tools/swift/Swift.php /tools/swift/Swift/Plugin/MailSend.php (around line 158) Old: $headers = $headers->build(); New: $headers = $headers->build(); $params = ""; /tools/swift/Swift/Message.php (around line 79) Old: $this->setFrom(""); New: $this->setFrom("yourmail@yourdomain"); /tools/swift/Swift.php (around line 370) Old: if (!($has_reply_to = $message->getReplyTo())) $message->setReplyTo($from); New: if (!($has_reply_to = $message->getReplyTo())) $message->setReplyTo($from); if (!$has_reply_to[0]) $message->setReplyTo($from->getAddress()); Thanks a lot...it worked for me.. 1 Link to comment Share on other sites More sharing options...
vmarkovic Posted August 30, 2014 Share Posted August 30, 2014 Message "Error: Please check your configuration Sending failed using mail() as PHP's default mail() function returned boolean FALSE." doesn't mean mail() cannot be used because it already returned result (it means it works but has issue). I found that this issue comes from duplicate entries in ps_configuration of PS_SHOP_EMAIL. Probably the first (and bad) entry contains something like [email protected] and the second one your valid shop email. Another thing is to configure emails in Customers > Contacts (default values are also like [email protected]). If you correct these issues, you don't have to fiddle in the scripts as suggested in above posts. Hi iknowsomethingcom, As I am also having issues with email sending, did tried to set SMTP and stuff like that, but none of it will work. Also when placing order or editing orders state in BO I get error: Error: Wrong email template. I was just reading your post and checked my pr_configuration for duplicate entries and I saw following, but I havent find any duplicate pr_shop_email entries: My emails are currently set to PHP mail() function in BO, so I belive these settings shouldnt be there. Any help is very apreciated, since no one is answering in my topic here. Regards, Vedran Link to comment Share on other sites More sharing options...
vekia Posted August 30, 2014 Share Posted August 30, 2014 Error: Wrong email template. check orders > statuses what kind of mail status your payment / order process use then verify if template file for this status exists Link to comment Share on other sites More sharing options...
vmarkovic Posted August 30, 2014 Share Posted August 30, 2014 check orders > statuses what kind of mail status your payment / order process use then verify if template file for this status exists Hi Milos, Tnx for your reply, I will check as soon as I have access to my PC. I am using cashondelivery and bankwire payment modules. Regards, Vedran Link to comment Share on other sites More sharing options...
vmarkovic Posted September 1, 2014 Share Posted September 1, 2014 Hi Milos,I just check Orders>Statuses and templates were missing for my statuses. I did select templates, and after making order it does not reporting Error: Wrong email template but still no mails from shop, neither to my "customer account" email, or for the email adresses setup in Mail Alert module. Regards,Vedran Link to comment Share on other sites More sharing options...
nikos93 Posted February 25, 2015 Share Posted February 25, 2015 also i have the same issue i try the changes that posted previously but didnt worked for me my version is 1.6.0.13 Link to comment Share on other sites More sharing options...
nikos93 Posted February 25, 2015 Share Posted February 25, 2015 (edited) also i have the same issue i try the changes that posted previously but didnt worked for me my version is 1.6.0.13 update i solve the problem by changing the php version from 5.4 to 5.5 from cpanel also for the history, i roll back the changes that i made by reading previously posts and still working Edited February 25, 2015 by nikos93 (see edit history) Link to comment Share on other sites More sharing options...
Shad86 Posted March 2, 2015 Share Posted March 2, 2015 (edited) Hey guys, I´ve sended 300 newsletter-mails over the Newsletter Pro Modul and now it shows: Sending failed using mail() as PHP's default mail() function returned boolean FALSE. What can I do to send more than 300 mails? Edit: I´ve made the changes but it´s the same. I think the problem is the server. I can only send 300 mails every 30 or 60 minutes. Edited March 2, 2015 by Shad86 (see edit history) Link to comment Share on other sites More sharing options...
gkssjovi Posted March 2, 2015 Share Posted March 2, 2015 Yes, the problem is from the server. But I recommend you to use a SMTP connection instead of php function mail(). Link to comment Share on other sites More sharing options...
Vascocst Posted May 4, 2015 Share Posted May 4, 2015 Error: Please check your configurationSending failed using mail() as PHP's default mail() function returned boolean FALSE. Hello my friends, Could anyone help me with the solution for PrestaShop™ 1.6.0.6 ? I had made the changes that the Sale Mechanics suggested, but it doesn't work. Thanks a lot Link to comment Share on other sites More sharing options...
PedroRamos Posted July 7, 2015 Share Posted July 7, 2015 Sale Mechanics solution Works! Thank you! Link to comment Share on other sites More sharing options...
hookahshop Posted November 7, 2015 Share Posted November 7, 2015 (edited) If you've tried mechanics solution and its not worked for you then you need to enable sendmail in your domains php.ini . If its not enabled in your php.ini file then prestashop wont be able to send using sendmail. I'd tried all the solutions mentioned here and was still unable to use sendmail. My server provider support eukhost edited the php.ini file in my domians root and it started working ! you may also need to restart exim service on your server if you're on a linux server Edited November 7, 2015 by hookahshop (see edit history) Link to comment Share on other sites More sharing options...
gaet182 Posted February 27, 2016 Share Posted February 27, 2016 Hi, I've tried all solutions listed above, I still get the same message in the log: Swift Error: Sending failed using mail() as PHP\'s default mail() function returned boolean FALSE. I also find the following message in the log whenever I'm placing an order, maybe there's a link? : Frontcontroller::init - Cart cannot be loaded or an order has already been placed using this cart I'm on prestashop 1.6.1.3. Thanks! Link to comment Share on other sites More sharing options...
dnicku Posted December 15, 2016 Share Posted December 15, 2016 I made my site batterydealer.in with prestashop. Its php mail is not working. My customers are even not receiving forgot password mail. Please help. Link to comment Share on other sites More sharing options...
Katy U Posted April 6, 2020 Share Posted April 6, 2020 Версия 1.6.0.6 помогло. Спасибо, Sale Mechanics! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now