Jump to content

Prestashop PHP email won't work


nemoku

Recommended Posts

Hello, i have a strange problem, PHP prestashop email funcion won't work, it worked one day, and since that day it does not work, tried move all FTP and SQL files  to other domain on the same hosting, but email funcion works without any problem.. So it's not the code error i think so.. Anyone had problem like this before?

Link to comment
Share on other sites

  • 2 weeks later...
When we use the PHP mail() function to send mail in Prestashop, it would not work as it return false code in MailSend.php.

 

To uses the mail() function in Prestashop, first check whether it is enabled on the server.This can be easily checked by using phpinfo page.

 

 

 

If mail function is enabled, then we need to follow the steps below to fix the issue to send mails

 

Step 1. Need to change code in three files. First, go to /tools/swift/Swift/Plugin/MailSend.php at line 158.

 

          Change

 



$headers = $headers->build();


To

 



$headers = $headers->build();


$params = "";


 

Step 2. Navigate to the /tools/swift/Swift/Message.php file at line 79. 

 

Change

 



$this->setFrom("");


 

To




$this->setFrom("[email protected]");


Step 3: Finally, navigate and change the /tools/swift/Swift.php file at line 370.

 

Change

 



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


To

 



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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...