Skip to content

Instantly share code, notes, and snippets.

@acepsaepudin
Last active November 3, 2015 07:58
Show Gist options
  • Save acepsaepudin/aa2df80e36ec4ce2411b to your computer and use it in GitHub Desktop.
Save acepsaepudin/aa2df80e36ec4ce2411b to your computer and use it in GitHub Desktop.
public function ceksmtp()
{
$fp = fsockopen("www.google.com", 80, $errno, $errstr, 10); // work fine
if (!$fp)
echo "www.google.com - $errstr ($errno)<br>\n";
else
echo "www.google.com - ok<br>\n";
$fp = fsockopen("smtp.gmail.com", 465, $errno, $errstr, 10); // NOT work
if (!$fp)
echo "smtp.gmail.com 465 - $errstr ($errno)<br>\n";
else
echo "smtp.gmail.com 465 - ok<br>\n";
$fp = fsockopen("smtp.gmail.com", 587, $errno, $errstr, 10); // NOT work
if (!$fp)
echo "smtp.gmail.com 587 - $errstr ($errno)<br>\n";
else
echo "smtp.gmail.com 587 - ok<br>\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment