Created
February 27, 2016 22:41
-
-
Save AbhishekGhosh/725e743512e2d54fb471 to your computer and use it in GitHub Desktop.
Check Port 25, 465, 587 whether open via PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// 5 is the timeout in seconds | |
// 25 is port, other ports you may check are 465 and 587 | |
$fp = fsockopen('127.0.0.1', 25, $errno, $errstr, 5); | |
if (!$fp) { | |
} else { | |
fclose($fp); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment