Cant send emails via Gmail SMTP, Timeout error
Hello,
i have an professional Wordpress plugin, MailPoet and it can send email via SMTP instead PHP mail.
When i try to connect gmail i get:
[23-Jun-2015 10:02:39 UTC] PHP Warning: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.gmail.com:443 (Connection timed out) in /home/username/public_html/wp-content/plugins/wysija-newsletters/inc/phpmailer/class.smtp.php on line 123
[23-Jun-2015 10:02:53 UTC] ERROR PostmanWpMail: Exception code=403 message=Error calling POST
-
In the error you posted, the port is 443 not 465. ssl://smtp.gmail.com:443 Also note that port 465 is SSL only. Port 25 is plain or may use STARTTLS. I think Gmail also supports port 587. 0 -
Thanks but it is NOT cause of the problem. unable to connect to ssl://smtp.gmail.com:465 unable to connect to smtp.gmail.com:25 unable to connect to smtp.gmail.com:465 unable to connect to smtp.gmail.com:587
i tried various ports. it just do not connect as mentioned above unable to connect to ssl://smtp.gmail.com:465 (Connection timed out)0 -
The cause is probably one of these three things? 1) In Config server firewall configuration, there is section "IPv4 Port Settings" & "IPv6 Port Settings", i think it may be needed to add SMTP ports 25,465,587 into all TCP_OUT UDP_OUT variables in both above mentioned sections. Then in same configuration CSF file, find section "SMTP Settings", set "SMTP_BLOCK =" to 0 or whitelist some cpanel users in variable "SMTP_ALLOWUSER =" Save config and restart csf, lfd. After that when logging via SSH to an cpanel account which i whitelisted (su - cpanelname), i see this: # telnet smtp.gmail.com 465 Trying 74.125.21.108... Connected to smtp.gmail.com. Escape character is '^]'.
but still my .php mailer says: "SMTP Error: Could not authenticate. | SMTP Error: Could not connect to SMTP host." 2) from WHM, check Home "Server Configuration "Tweak Settings - Restrict outgoing SMTP to root, exim, and mailman (FKA SMTP Tweak) [?] (Enabling this feature will redirect outgoing SMTP connections to the local mail server. root, exim, and mailman are still allowed to make direct connections.) 3) try to add gmail smtp IP (do command: telnet smtp.gmail.com 465) into config server firewall whitelist and ignore list?0 -
Hello :) Has modifying any of those settings made a difference in the behavior of your application? Thank you. 0 -
The cause is probably one of these three things? 1) In Config server firewall configuration, there is section "IPv4 Port Settings" & "IPv6 Port Settings", i think it may be needed to add SMTP ports 25,465,587 into all TCP_OUT UDP_OUT variables in both above mentioned sections. Then in same configuration CSF file, find section "SMTP Settings", set "SMTP_BLOCK =" to 0 or whitelist some cpanel users in variable "SMTP_ALLOWUSER =" Save config and restart csf, lfd. After that when logging via SSH to an cpanel account which i whitelisted (su - cpanelname), i see this: but still my .php mailer says: "SMTP Error: Could not authenticate. | SMTP Error: Could not connect to SMTP host." 2) from WHM, check Home "Server Configuration "Tweak Settings - Restrict outgoing SMTP to root, exim, and mailman (FKA SMTP Tweak) [?] (Enabling this feature will redirect outgoing SMTP connections to the local mail server. root, exim, and mailman are still allowed to make direct connections.) 3) try to add gmail smtp IP (do command: telnet smtp.gmail.com 465) into config server firewall whitelist and ignore list?
I know this thread is old but it really helped me out. In my case, step 2) was the root cause. After updating that in WHM, I also needed to go through some troubleshooting steps to allow less secure apps to send email through my gmail account. This basically got me where I needed to go. Thanks!0
Please sign in to leave a comment.
Comments
5 comments