Gmail Smtp Connection Problem

Does the mailtest.php file I posted return OK?

I just cheekcd again and the mailtest.php have error as below
Warning: fsockopen(): unable to connect to ssl://smtp.gmail.com:465 (Network is unreachable) in /home/shop/public_html/mailtest.php on line 9

Hi

i have the same Problem kindly let me know how to solve it, i did exactly what here send buy i am getting still the same error,

kindly help me to solve it

Error Message could not be sent.
Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

thanks

Hi

I just checkcd again and the mailtest.php have error as below
Warning: fsockopen(): unable to connect to ssl://smtp.gmail.com:465 (Network is unreachable) in /home/shop/public_html/mailtest.php on line 9
kindly let me know how i can enable ssl socket transport support in my WHM Panel?.
Thanks

Suggest you ssh into your server and run

# ping smtp.gmail.com

It should return a bunch of round-trip summaries. If not, then your hosting has a network problem or 'gmail' is down.

People really should be using something like Sendgrid for smtp relay. Trying to tunnel through Gsuite or Office365 is difficult and constantly changing.

Suggest you ssh into your server and run

# ping smtp.gmail.com

It should return a bunch of round-trip summaries. If not, then your hosting has a network problem or 'gmail' is down.

Hi

thanks for your kind reply i have run via SHH as you said and its ends like the that

64 bytes from wl-in-f108.1e100.net (64.233.167.108): icmp_seq=83 ttl=46 time=15.9 ms
64 bytes from wl-in-f108.1e100.net (64.233.167.108): icmp_seq=84 ttl=46 time=15.9 ms
64 bytes from wl-in-f108.1e100.net (64.233.167.108): icmp_seq=85 ttl=46 time=15.9 ms
64 bytes from wl-in-f108.1e100.net (64.233.167.108): icmp_seq=86 ttl=46 time=15.9 ms
^C
--- smtp.gmail.com ping statistics ---
86 packets transmitted, 86 received, 0% packet loss, time 85116ms
rtt min/avg/max/mdev = 15.891/16.059/18.408/0.401 ms
[myshop@host public_html]$ ^C

Then your server CAN connect to smtp.gmail.com at that point in time. Have you tried generating another email since you ping'd?

Then your server CAN connect to smtp.gmail.com at that point in time. Have you tried generating another email since you ping'd?

Hi

I have not tried any other, can you tell me how can i connect to smtp.gmail.com? as i have root access and i can do if you tell me how to fix it?

many thanks

What I was suggesting is that you generate another email through the system. I.e. send an invoice to admin to see if it works now that you know the core connection works. But again, I'd put a marker in your PHP error_log file (a single line with the date/time) and then try to send the mail. If it fails, review the error_log AFTER your timestamp. If you need help, you can contact me through the 'get a quote' link in my signature. It won't be free, but it will be reasonable.

Make sure you turn OFF your secure app access in your Gsuite or Google account...that was the kicker for me. The settings above worked fine. Also had to make sure port 465 outgoing was open.