$hostname = "www.seek4info.com";
if (!isset($hostname))
die("\$hostname variable is not set");
if (empty($hostname))
die("\$hostname variable is empty");
echo $hostname . " - ";
if (checkdnsrr($hostname))
echo "has a valid MX record";
else
die("is not exist");
/*
run:
www.seek4info.com - has a valid MX record
*/