If you want to use getmxrr on windows, be careful as choward AT fast DOT net DOT NO SPAM PLZ's function has a security flaw.
It passes its argument to an external command without escaping it. If you don't validate the input, someone may manage to run nasty things on your system.
Here's a fixed version (just added escapeshellarg())
<?php
function getmxrr($hostname, &$mxhosts)
{
$mxhosts = array();
exec('%SYSTEMDIRECTORY%\\nslookup.exe -q=mx '.escapeshellarg($hostname), $result_arr);
foreach($result_arr as $line)
{
if (preg_match("/.*mail exchanger = (.*)/", $line, $matches))
$mxhosts[] = $matches[1];
}
return( count($mxhosts) > 0 );
}getmxrr('yahoo.com', $mxhosts);
print_r($mxhosts);
?>
This way you'll avoid a lot of nasty things ;)