Jump to content

SMTP configuration error on Prestashop


Recommended Posts

Hello,

 

I am looking for someone help me on my email configuration. There are couple of things make me frustrating.

 

First, PHP mail function on my presta does not work, when I send an email test I get the following message: Error: Please check your configuration. And it happens on using 'Set my own SMTP parameter' as well.

Actually I have test out the smtp configuration i put is correct with server, user and password. Also follow some solutions I made change like: 

In /tools/swift/Swift/Message.php line #79

Change

$this->setFrom("");

To

$this->setFrom("[email protected]");
 
In /tools/swift/Swift.php after line 370
if (!($has_reply_to = $message->getReplyTo())) $message->setReplyTo($from);

Add the following code:

if (!$has_reply_to[0])
$message->setReplyTo($from->getAddress());
In /tools/swift/Swift/Plugin/MailSend.php line # 159

Add

$params "";
 
However still get same error message.
 
Second, the most weird things is cannot get error detail message. The message I only get is :Error: Please check your configuration  Even after I already open errors display on config.inc.php by
 ini_set('memory_limit','128M'); 
/* Debug only */
@ini_set('display_errors', 'on');
define('_PS_DEBUG_SQL_', true);
error_reporting("E_ALL");
 
Could you please help me finding a solution? I am using version 1.4.6.2

Thank you
Link to comment
Share on other sites

Yes, I can use php test page to send email from my web hosting, and the smtp configuration works on my outlook. Also I tried to change encryption and port, still cannot solve problem.

Could you find the reason why get nothing return on error message? Even cannot display on firebug.

Link to comment
Share on other sites

It's weird and suspactable that both PHP's mail function and SMTP wouldn't work.

It's hard to tell, yet I would try to narrow down the issue by first checking PHP's mail function and see if it's disabled by PHP configuration first. If not, I'd then try to send a test mail using a simple separate PHP script.

On the other hand, to test if -for some reason- the email is rejected by the recipient server, I'd try to send an email to a server accepting all email including spam or anything.

Link to comment
Share on other sites

I create a separate php page

 

<?php
$to = "[email protected]";
$header = "From: {$to}";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body, $header)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}
?>

 

and enable to receive the test email, so mail function is enabled in my server now.

The recipient server is fine with all mails sent from my webmail.

Really don't understand why there isn't any detail error messages while using own smtp parameters. 

Link to comment
Share on other sites

  • 8 months later...

I am puzzled. In #5 you use the php mail() function to send mail. But in Prestashop you insist on not using that function and instead setting the smtp settings yourself.

Their php may be configured to use an SMTP server.

 

So i imagine they are just saying that mails work properly when using php mail, which is just wrapping an SMTP server.  So if SMTP works properly on his host, then why does it not work properly when Prestashop uses SMTP directly.

 

The answer is likely related to the fact that Prestashop uses a 7 year old mail library to send mails, named SwiftMailer.

Link to comment
Share on other sites

×
×
  • Create New...