Using Magento 2.3.3 and Mageplaza SMTP extension. Got errors with when gmail account "Less Secure App Access" is turn OFF.
1. Could not open socket: stream_socket_client(): unable to connect to tcp://smtp.gmail.com:465 (Network is unreachable)
2. 5.7.8 Username and Password not accepted. Learn more at 5.7.8 support google com / mail / ? p=BadCredentials y5sm2165638ilk.83 - gsmtp
It ONLY WORKS if "Less Secure App Access" is turn ON, which Google does not recommend. I will appreciate any suggestions. Thanks for your attention.
Solved! Go to Solution.
Hello @Sheba
if you want to use Google SMTP then you must need to enable a less secure app setting.
More info:-
https://www.mageplaza.com/blog/configure-gmail-smtp-magento-2.html
if works then mark as solution.
It's just a Google thing. It's a pain to integrate their mail with anything that's not google or their partner.
Hello @Sheba
if you want to use Google SMTP then you must need to enable a less secure app setting.
More info:-
https://www.mageplaza.com/blog/configure-gmail-smtp-magento-2.html
if works then mark as solution.
The only solution that worked for me:
SELINUX BLOCKING If you are getting error message like SMTP -> ERROR: Failed to connect to server: Permission denied (13), Permission denied, and your are hosting on RedHat / Fedora / Centos this is more than likely cause by SELinux preventing PHP or the web server from sending email. . Using the getsebool command we can check if the httpd daemon is allowed to make a connection over the network and send an email:
getsebool httpd_can_sendmail getsebool httpd_can_network_connect
This command will return a boolean on or off. If it’s off, we can turn it on:
sudo setsebool -P httpd_can_sendmail 1 sudo setsebool -P httpd_can_network_connect 1
Thanks to MagePal here is their full documentation
I turn on the Gmail policy to allow low secure apps
and then select TLS instead SSL and use the port 567 instead 465
this works for me
+juanremi