The default error report of PrestaShop SMTP configuration is very vague.
I could swear to god, I made sure my SMTP passwords etc were configured correctly. But unfortunately, the SMTP sending of PrestaShop mail always reports an error, and we can’t do anything about it.
We don’t know what happened, so we need to change the code and tell us the error, so that we can solve the problem.
1.Change your file vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php, add 2 lines of code as shown in the figure.(Around line 486)
Let’s send the mail again and see what happens.
Expected response code 250/251/252 but got code “550”, with message “550-Sorry 184.108.40.206. The “MAIL FROM” email address firstname.lastname@example.org / presta-modules-addons.comd you are 550-using is not hosted on this server. Tried to use email@example.com / presta-modules-addons.comd as mail 550-from address. Sending mails from addresses not hosted on our server is not 550-allowed. Please check the “MAIL FROM” settings of your mail client and make 550-sure you set the “MAIL FROM” address to an email account which is hosted on 550 the server. “email Send a test email
Oh, great, we finally know why the email failed to be sent according to the error message. It turns out that the sender of the email must be a good SMTP domain name!
Next we fix this problem.
Double confirm my SMTP configuration(CONFIGURE->Advanced Parameters->E-mail)
OK, this time I confirm that the sender of the email, the email server and the email SMTP account are all under one domain name and are consistent, and we will send the email again.
Go to the mail server to see if I have received the mail.
OK, it worked, great, I received an email from PrestaShop SMTP and successfully configured PrestaShop SMTP~
PrestaShop SMTP sending failed, Improve the SMTP configuration success rate, Display the reason for the failure to send emails!