PHP/DNS/dns get mx
Using the dns_get_mx() Function
<?php
$hostname = "google.ru";
if(dns_get_mx($hostname, $mxhosts, $weights)) {
foreach($mxhosts as $key => $host) {
echo "Hostname: $host (Weight: {$weights[$key]}<BR/>\n";
}
} else {
echo "Could not find any MX records for $hostname\n";
}
?>