Testing open port for smtp gmail

$fp = fsockopen(“www.google.com”, 80, &$errno, &$errstr, 10); // work fine if (!$fp) echo “www.google.com - $errstr ($errno)
n”; else echo “www.google.com - ok
n”; $fp = fsockopen(“smtp.gmail.com”, 465, &$errno, &$errstr, 10); // NOT work if (!$fp) echo “smtp.gmail.com 465 - $errstr ($errno)
n”; else echo “smtp.gmail.com 465 - ok
n”; $fp = fsockopen(“smtp.gmail.com”, 587, &$errno, &$errstr, 10); // NOT work if (!$fp) echo “smtp.gmail.com 587 - $errstr ($errno)
n”; else echo “smtp.gmail.com 587 - ok
n”; exit();

Subscribe to You Live What You Learn

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.