I have a very simple snippet of code which connects to a SMTP server using fsockopen (or alternatively stream_socket-client) that looks like this:
<?php
$url = gethostbyname("mx6.go2.pl");
echo $url;
$fp = fsockopen($url, 587, $errno, $errstr, 10);
if (!$fp) {
echo "port is closed or blocked"
} else {
echo "port is open and available";
fclose($fp);
}
?>
Unfortunately, I cannot connect to any of the standard ports like 25,587 or 2525 because my both host providers are blocking any outbound connections using those ports. (I can only connect to internal SMTP server or localhost via 25 or 587)
Is there a way to go round this problem using different code or ports (I mean programmatically and not something like installing my own server).
Cheers,
Marcin