Jump to content

prestashop 1.7.7 php mail problems


Recommended Posts

Hi

My installation of prestashop 1.7.7 will not send mail from the php mail() function. It gives this error when tested: 

Error: Please check your configuration.Expected response code 220 but got an empty response.

The hosting company won't allow connection over SMTP can anyone shed any light on why or how I can get the php mail() function to work? I've tested with another mail script on the server and it will send but only to a gmail address! Any help is much appreciated. 

Thanks

Jon

  • Like 3
Link to comment
Share on other sites

  • 3 months later...

I just found this comment  ...

"After further investigation, it looks like the root cause of this issue is that we're not using the mail() function anymore for security reasons and using /usr/sbin/sendmail instead, which led to use proc_open."

I've had to take proc_open out of my disable_functions within my php.ini and now sendmail is sending email!

Stupid though ... they have forced us to use sendmail instead of mail for security reasons, but we have to enable proc_open for it to work?????

 

Link to comment
Share on other sites

vor 14 Stunden schrieb GSafar30:

Hello SliderFlash, but I contacted Ionos, and my contract allows me to create email addresses, but I cannot configure the SMTP on Prestashop because I would need a dedicated server, while with my contract I have a shared server. Thanks anyway.

Can't you create a POP or IMAP mailbox ?

Link to comment
Share on other sites

vor 12 Minuten schrieb GSafar30:

It is beyond me, but I'm not the only one to have this problem with Ionos. They say I need a dedicated server to configure SMTP on Prestashop and I have a shared server.

That's bullshit, they want money that's what it's all about ! then look for another hoster.

Link to comment
Share on other sites

  • 2 weeks later...

This might or might not help someone. I found this thread while looking for a solution to a problem with the contact form (no active send button). I'm working in 1.7.7.0, not yet live but testing the final build. For the send button, I found it was inactive because in the GDPR module I had checked that I wanted a confirmation checkbox to appear on the contact form ... but nothing was there, so nothing was checked and the button was inactive. Turning this off, the contact form worked.

But for a long time I was looking for a change to the email. In 1.7.7.0 I have read that the first option, sendmail, has been stopped from working because of a security issue. That means you have to configure SMTP. My account is with Ionos and a shared server. However, Ionos is a web hosting service and users presumably also have an ISP broadband supply to get online. I have Plusnet for this and that handles my email ... so I used the SMTP configuration for Plusnet. I don't think it would matter which ISP is used ... they would all, I assume, come with the ability to set up SMTP. Basically, send your emails through the ISP and not through Ionos to solve this.

Hope it helps someone.

Link to comment
Share on other sites

I got mine working on a ionos hosted doing the following.

Mail domain name: BLANK

SMTP server: smtp.ionos.com

SMTP Username:  *@yourdomain.com  "You have to have an email address created through ionos hosting"

SMTP password: "your ionos hosted email password from above setup"

Encryption: SSL

Port: 465

Edited by cdelicath81 (see edit history)
  • Thanks 4
Link to comment
Share on other sites

4 hours ago, ecentury said:

Works for me by just removing the proc_open from the disable_functions

Its not just on the test email option, no email sends with this disabled, including password recovery emails

Using krystal hosting if that helps anyone

where can I finid it please?

Link to comment
Share on other sites

On 12/8/2020 at 11:01 AM, kierweb said:

I just found this comment  ...

"After further investigation, it looks like the root cause of this issue is that we're not using the mail() function anymore for security reasons and using /usr/sbin/sendmail instead, which led to use proc_open."

I've had to take proc_open out of my disable_functions within my php.ini and now sendmail is sending email!

Stupid though ... they have forced us to use sendmail instead of mail for security reasons, but we have to enable proc_open for it to work?????

 

Where can I find it please

Link to comment
Share on other sites

Hello,
I have a similar problem. I newly founded an eshop with prestashop version 1.7.7.0 and I can't send any emails. According to the information here, it is possible to send using smtp, which unfortunately has my hosting disabled (cesky-hosting.cz).
My question is, what should I do to send emails using sendmail?
Thank you very much in advance for your help.

Edited by Lukascisar
problem solved - https://github.com/PrestaShop/PrestaShop/issues/22262 (see edit history)
Link to comment
Share on other sites

I got mine working on a ionos hosted doing the following.

Mail domain name:     

SMTP server:         auth.smtp.1and1.fr

SMTP Username:      *@yourdomain.com  "You have to have an email address created through ionos hosting"

SMTP password:         "your ionos hosted email password from above setup"

Encryption:         SSL

Port:             465

If it can help someone....

Link to comment
Share on other sites

On 12/29/2020 at 3:10 AM, cdelicath81 said:

I got mine working on a ionos hosted doing the following.

Mail domain name: BLANK

SMTP server: smtp.ionos.com

SMTP Username:  *@yourdomain.com  "You have to have an email address created through ionos hosting"

SMTP password: "your ionos hosted email password from above setup"

Encryption: SSL

Port: 465

its work !, thanks so much

Link to comment
Share on other sites

Hello,

After upgrading Prestashop to 1.7.7.1 the email system doesn't work to me as well.

I tried with suggestion reached in this topic.
My host is IONOS on a shared server.
I tried with SMTP parameters:
(I have this parameter in my IONOS ACCOUNT)

smtp.ionos.it

TLS 587

In Prestashop TEST mail  it works. The test email is sent to the email address I choose, but if I replay to a Customer in Customer Service it doesn't work.

I think SMTP paramters in prestashop should be work as another email client.
I tried already with
SSL PORT 465 or
no protected conncection with PORT 25.

Always the TEST email was sent, but never from customer service.
________________________________________________________________________

UPDATE: I found the emails go to spam folder.
So the problem is not Prestashop, but my hosting provider.
Any idea?

Here my Prestashop configuration (attached):

Do you have an idea?

Screenshot from 2021-02-05 14-55-18.png

Edited by mikirimiki (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...

Fehler: Bitte prüfen Sie Ihre Einstellungen

Failed to authenticate on SMTP server with username "MyEmail" using 2 possible authenticators. Authenticator LOGIN returned Expected response code 235 but got code "535", with message "535 Authentication credentials invalid ". Authenticator PLAIN returned Expected response code 235 but got code "535", with message "535 Authentication credentials invalid ".

Link to comment
Share on other sites

vor 43 Minuten schrieb HemaShop:

Fehler: Bitte prüfen Sie Ihre Einstellungen

Failed to authenticate on SMTP server with username "MyEmail" using 2 possible authenticators. Authenticator LOGIN returned Expected response code 235 but got code "535", with message "535 Authentication credentials invalid ". Authenticator PLAIN returned Expected response code 235 but got code "535", with message "535 Authentication credentials invalid ".

incorrect user: ->SMTP server with username "MyEmail"

Link to comment
Share on other sites

  • 1 month later...

I am facing the same problems. the prestashop and email accounts are both hosted in ionos.com

with SSL and port 465:

Error: Please check your configuration

Failed to authenticate on SMTP server with username "XXXXXXXX" using 2 possible authenticators. Authenticator LOGIN returned Expected response code 235 but got code "535", with message "535 Authentication credentials invalid ". Authenticator PLAIN returned Expected response code 235 but got code "535", with message "535 Authentication credentials invalid ".

with TLS and port 465:

Error: Please check your configuration

Expected response code 220 but got an empty response

 

with TLS and port 587:

Error: Please check your configuration

Failed to authenticate on SMTP server with username "XXXXXXXX" using 2 possible authenticators. Authenticator LOGIN returned Expected response code 235 but got code "535", with message "535 Authentication credentials invalid ". Authenticator PLAIN returned Expected response code 235 but got code "535", with message "535 Authentication credentials invalid ".

Link to comment
Share on other sites

  • 2 months later...
On 1/4/2021 at 7:07 PM, halhassan said:

Where can I find it please

No one replied to this poor fellow.

At least 2 members mentioned this solution, but they don't elaborate.

I do have a php.ini file, but no line specifically deactivates this proc_open thing. 

I can't get emails to work with SMTP, and I've tried different SMTP servers. I don't know if It's related to MFA or some other thing (gmail can block third party apps for example), so I'd like to do this the non-SMTP way and see if I can get it to work like that. But I don't understand where this proc_open is being disabled.

Thanks!

EDIT: My hosting company says they deactivated proc_open by default due to security reasons. So basically, in my case, I have to use SMTP. I will try to use different mail servers to set this up.

Edited by Higino (see edit history)
Link to comment
Share on other sites

  • 4 weeks later...

We had the same problem. My hoster found the solution. It was the old version of SwiftMailer.

The error we got was:
 

Symfony\Component\Debug\Exception\UndefinedMethodException:
Attempted to call an undefined method named "newInstance" of class "Swift_SmtpTransport".

at override/classes/Mail.php:714
at MailCore::sendMailTest('1', 'mail.agenturserver.de', 'Dies ist eine Test-Mail. Ihr Server kann nun E-Mails versenden.', 'Test-Nachricht -- PrestaShop', 'text/html', '[Email-Adress]', '[Email-Adress]', '[User-Name]', '[Password]', '465', 'ssl')
(src/Adapter/Email/EmailConfigurationTester.php:99)
at PrestaShop\PrestaShop\Adapter\Email\EmailConfigurationTester->testConfiguration(array('send_email_to' => '[Email-Adress]', 'mail_method' => '2', 'smtp_server' => 'mail.agenturserver.de', 'smtp_username' => '[Username]', 'smtp_password' => null, 'smtp_port' => '465', 'smtp_encryption' => 'ssl'))
(src/PrestaShopBundle/Controller/Admin/Configure/AdvancedParameters/EmailController.php:261)
at PrestaShopBundle\Controller\Admin\Configure\AdvancedParameters\EmailController->sendTestAction(object(Request))
(vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:151)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
(vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68)
at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, false)
(vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:200)
at Symfony\Component\HttpKernel\Kernel->handle(object(Request), 1, false)
(admin/index.php:82)

 

We changed following things in the file /overrides/classes/Mail.php:

Old:
##

709 try {
710 if ($smtpChecked) {
711 if (Tools::strtolower($smtpEncryption) === 'off') {
712 $smtpEncryption = false;
713 }
714 $smtp = \Swift_SmtpTransport::newInstance($smtp_server, $smtpPort, $smtpEncryption)
715 ->setUsername($smtpLogin)
716 ->setPassword($smtpPassword);
717 $swift = \Swift_Mailer::newInstance($smtp);
718 } else {
719 $swift = \Swift_Mailer::newInstance(\Swift_MailTransport::newInstance());
720 }
721
722 $message = \Swift_Message::newInstance();
723
724 $message
725 ->setFrom($from)
726 ->setTo($to)
727 ->setSubject($subject)
728 ->setBody($content);
729
730 if ($swift->send($message)) {
731 $result = true;
732 }
733 } catch (\Swift_SwiftException $e) {
734 $result = $e->getMessage();
735 }
736
737 return $result;
738 }

##

New:

##

709 try {
710 if ($smtpChecked) {
711 if (Tools::strtolower($smtpEncryption) === 'off') {
712 $smtpEncryption = false;
713 }
714 $smtp = new \Swift_SmtpTransport($smtp_server, $smtpPort, $smtpEncryption);
715 $smtp
716 ->setUsername($smtpLogin)
717 ->setPassword($smtpPassword);
718 $swift = new \Swift_Mailer($smtp);
719 } else {
720 $swift = new \Swift_Mailer(new \Swift_MailTransport());
721 }
722
723 $message = new \Swift_Message();
724
725 $message
726 ->setFrom($from)
727 ->setTo($to)
728 ->setSubject($subject)
729 ->setBody($content);
730
731 if ($swift->send($message)) {
732 $result = true;
733 }
734 } catch (\Swift_SwiftException $e) {
735 $result = $e->getMessage();
736 }
737
738 return $result;
739 }

##

 

The reason for this error is, ::newInstance doesn´t work anymore in PHP.

Hope, this helps you all!

Link to comment
Share on other sites

  • 3 weeks later...
On 8/7/2020 at 3:56 PM, jondrew said:

Hi

My installation of prestashop 1.7.7 will not send mail from the php mail() function. It gives this error when tested: 

Error: Please check your configuration.Expected response code 220 but got an empty response.

The hosting company won't allow connection over SMTP can anyone shed any light on why or how I can get the php mail() function to work? I've tested with another mail script on the server and it will send but only to a gmail address! Any help is much appreciated. 

Thanks

Jon

"535 Authentication credentials invalid" , errors mostly come from auth type failure 

Please do check your auth type 

 

Please do active your logs which will helpful to troubleshoot more

 

Thanks

Regards

Freelance SMTP Expert

Migomail & Mailcot

Link to comment
Share on other sites

  • 2 months later...
On 1/28/2021 at 9:44 PM, cassandra8 said:

HalHassan: Were you able to get working with siteground? I have contacted them and they say it is on the prestashop side and they cannot help. I still have not been able to get working.

I had this same problem with Siteground. Nothing I tried seem to work.

Then I copied the settings as those are in Thunderbird. Using SSL and port 465.

Still the testmail gives an error, but all the "real" messages are sent to the customer. Don't know nor care what is wrong as long as the customer mails are working 😄

Link to comment
Share on other sites

this is what I set at siteground that finally worked for us.

Prestashop admin panel:

settings under email:
smtp server : xxxxxx.com
username: xxxxx.com or [email protected]
password: xxxxxx
encyption: ssl
port 465

settings under Traffic and Seo  at bottom:
shop domain: www.xxxxx.com
ssl domain : www.xxxx.com
base url: /

Server side:

email:
xxxxx.com or [email protected]
incoming server:
xxxxx.com
imap port 993
pop3 port 995
outgoing srver: xxxxxx.com
smtp port 465

if this does not work check that the domain zone editor settitngs are correct under mx

we could never get working with php under siteground.

  • Thanks 1
Link to comment
Share on other sites

  • 4 weeks later...

Hi Cassandra8,

I have hosting with siteground and facing the same "email" problem. I have used setting same as you have mentioned above. Now I have the following message in prestashop: Error: Please check your configuration. You have also mentioned to check the domain zone editor settings are correct under mx. I can see only these settings under mx: 

mx30.mailspamprotection.com. with priority 30

mx20.mailspamprotection.com. with priority 20

mx10.mailspamprotection.com. with priority 10

Should I create new record? Could you please advise me how to set it up correctly? Please see attached image below from my siteground account. Thank you in advance.

siteground mx records.jpg

Link to comment
Share on other sites

Thank you for your quick reply cassandra8. I have spent few hours with no luck. After have seen a few suggestions, I am going to stick to gmail account instead of siteground one.  How exactly did you create new record under mx?  nDid you put     alt4.aspmx.l.google.com.   in priority and destination fields? Is smtp server name the same as your domain? 

Edited by Gereon (see edit history)
Link to comment
Share on other sites

go to mx and fill out mx to your siteground name

ttl is 60 seconds,

priority 10

destination as above. That was all I did.

On prestashop everything is the the way I described above. This is what worked for me.

My .com name is an alias of the master google account. You may want to check that in google email.

  • Thanks 1
Link to comment
Share on other sites

Cassandra8, thank you once again. Finally I got this work using gmail account. In my case I used the following settings:

SMTP server: smtp.gmail.com

SMTP username: [email protected]

SMTP password: you have to use 16-digit passcode. First you have to set 2 step verification for your google account, then you can generate  this 16 digit passcode for app.

 Encryption: SSL

Port: 465

settings under Traffic and Seo  at bottom:
shop domain: www.xxxxx.com
ssl domain : www.xxxx.com
base url: /

Then I sent test mail and it all worked. I didn´t set anything in domain zone editor. Thank you once again.

This thread might be also usefull: 

 

Link to comment
Share on other sites

  • 1 month later...
  • 4 weeks later...
On 1/27/2022 at 6:42 PM, AlbertoCasado said:

Hello, It also fails me, and if I use the html protocol the following error appears:

the login configuration is correct. What I can do? The error jumped me when updating prestashop to version 1.7.8.2

 

error.jpg

The smpt username and password not correct. i suggest change password and try again....

Link to comment
Share on other sites

  • 6 months later...
  • 5 months later...

I've just solved this problem (on a IONOS.it shared plan) by:

-removing the special characters from my email password AND

-by using the same password for the email and the PS back office (every time I saved the email configuration, the email password in the database would change to the back-office password). And

-by using port 25 (instead of 465 as indicated on the Ionos website to configure an email client).

Link to comment
Share on other sites

  • 9 months later...

Hi 

I had  this problem   sending emails to customers  on Prestashop version 1.7.8.6  with  SMPT  our  server settings .

I checked with our  hosting  company  and they told me it was a prestashop issue  after we checked the Smtp config together.

I contacted  them again the next day with another support agent and we got to the issue in the end.  I mentioned to the agent that i had a message under where you put the port number (465)   the message was " SSL does not seem to be supported by the host"   with that  info  he figured it out.  

The problem was  that when we sent out a newsletter 2 weeks before   it went over the limit  allowed per day and our hosting company  blocked the smtp function. 

they unblocked this  restriction and within 15 minutes the  problem was solved .

 

 

 

 

 

 

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...