Jump to content

Issue with sending emails via mail() and SMTP


deyan4

Recommended Posts

Hello,

 

I´ve been fighting for days already to fix this issue.

 

When I try to send an email via the mail() function of Prestashop it says that the message has been sent correctly but it is never received. I've tried to send it to a different test emails.

 

I've also tried to fix it by applying these changes:

 

http://www.presto-changeo.com/es/content/9-fix-email-problems

 

But without a success.

 

Then I tried to configure the SMTP. After a couple of errors that I've received I could get to the right configuration, but still yet not sending the emails. It doesn't stop loading without throwing any error.

 

I've enabled the less secure devices in my gmail business account and it's configured to receive emails. The spam folder is also empty. 

 

This is my SMTP configuration:

 

http://cmswebserv.com/img/mail.png

 

It's very strange that when I save it, the password field doesn't save the password and it's empty.

 

What shall I do?

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

I've found this fatal error in my error_log:

PHP Fatal error:  Class 'Swift_Authenticator_PLAIN' not found in /var/www/vhosts/mydomain/httpdocs/tools/swift/Swift/Connection/SMTP.php on line 365

and line 365 is:

$this->attachAuthenticator(new $class());

I think I fixed this. In the /tools/swift/Swift/Authenticator/PLAIN.php file were missing the opening and closing PHP tags (OMG).

 

but still not sending emails...

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

  • 3 months later...

I am working with PrestaShop version 1.6.1.6

And my SMTP issues look similar to those of deyan4.

 

Sending out emails via PHP mail works - but with the wrong from address

 

With SMTP. The password field is empty.

The test receiver gets nothing.

Have not found any error messages yet.

Link to comment
Share on other sites

I'm working with PS 1.6.1.9 and am experiencing the same issues than @deyan4 and @Matjung.

 

Originally after installing PS and configuring SMTP mail services, everything was working ok, notification mails were sent alright to customers and vendor.

 

After a few months, sudenly it stopped working, but I did not realize it until a customer sent us an email through the contact form, which was received ok in my mail inbox, but on PS custom service instead of the actual message there is no subject line and the message content is a weird MD5 like string of characters in two rows, this is part of one of such rows ...ByZWNpYmlkbyB1biB2YWxlIGRlc2N1ZW50by4gTm8gZW5jdW...

 

Then I asked my hosting provider to check if there were any problems or misfuntions on mail servers, and if they could explain such a weird behaviour, they confirmed no issues on mail servers, but they think that code could mean a severe PS misfuntion or an attack attempt.

 

After struggling for several day on this issue and trying most of the solutions suggested on many forums I had achieved no success.

 

Please, if someone has reached even a partial solution, try to share it here.

 

Thanks in advance.

Link to comment
Share on other sites

  • 4 months later...

IF you're sure that all data are exact

 

the problem is:

 

error by Presta devs, not so unusual, unfortunately...

 

the Password field for SMTP settings doesn't accept some special chars, I don't know which exactly because I should check the code... BUT

eg. < ~ and maybe also ! are not accepted

 

so, you can even try 1000 times...and it doesn't work for sure if your email account password has those chars inside

so, at the moment you are forced to change your password

 

and also, no error message and no explanation about this. It should be there for sure, but is not there...instead

I don't know how it's possible, but that is...

 

p.s.: on database, please check your PS_MAIL_PASSWD field on ps_configuration table

Edited by mmsh (see edit history)
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...