check-port.php 222 B

123456789101112
  1. <?php
  2. $host = "smtp.sendgrid.net";
  3. $port = 2525;
  4. if (!$socket = @fsockopen($host, $port, $errno, $errstr, 3)) {
  5. echo "Port $port is CLOSED or OFFLINE";
  6. } else {
  7. echo "Port $port is OPEN";
  8. fclose($socket);
  9. }