Source Code:
(back to article)
<?php $hostname = "example.com"; $mxhosts = []; $weight = []; if (getmxrr($hostname, $mxhosts, $weight)) { for ($i = 0; $i < count($mxhosts); $i++) { echo "MX record for $hostname: " . $mxhosts[$i] . ", Weight: " . $weight[$i] ; } } else { echo "No MX record found for $hostname"; }
Result:
Report an issue