I can not send e-mail by SMTP
I am sending mail using phpmailer with google apps.
The error appears to me is:
SMTP ERROR: Failed to connect to server: Network is unreachable (101) 2016-08-30 23:09:33 SMTP connect() failed.
Code:
$mail->Host = "smtp.gmail.com";
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'ssl';
$mail->Port=465;
I made no change in the code and the server.
No have firewall.
-
Network is unreachable
Have you tried pinging smtp.gmail.com ?? Does it work? Seems like a connectivity issue between your server / ISP and gmail. Nothing to do with cPanel mostly.0 -
Hello :), There is an issues with the firewall. Please try to disabled your server firewall and your script again. 0 -
Hello, Your access level is listed as "Website Owner". Do you have root access to this system? If not, please report this issue to your web hosting provider, as it's possible new firewall rules were added or changes to the "WHM >> SMTP Restrictions" option were made. Thank you. 0 -
Yes, I have root access. "SMTP Restrictions" this disable. You do not have the server firewall. It seems that the port 465 and 587 blocked ... Any other suggestions? thanks 0 -
You have to determine whether it's a network problem; or issues with PHP mailer or your code. On your server, from a command prompt, try using telnet to connect to smtp.gmail.com on port 587 and 465, like so: telnet smtp.gmail.com 587 You should see a response from smtp.gmail.com as Connected. If the connection attempt hang and eventually time out it could mean that your hosting company is blocking outgoing SMTP connections on port 587 and 465 0 -
The problem was solved. The server network was in trouble. 0 -
I'm happy to see the issue is now resolved. Thank you for updating us with the outcome. 0 -
In some cases a simple request to your ISP will get them to unblock Port 25 for you, or sometimes simply using Port 587 for your SMTP will work, but in some cases your ISP may instead require you to use their SMTP server setting for outgoing mail. 0
Please sign in to leave a comment.
Comments
8 comments