<?php $domaine = "google.fr"; if(dns_get_mx($domaine, $mxhosts, $weights)) { foreach($mxhosts as $key => $host) { echo "Nom de domaine: $host (Weight: {$weights[$key]})<BR/>"; } } else { echo "Aucun enregistrement Mail Exchange trouvé pour $domaine"; } ?>