我想知道这个网站http://verify-email.org/如何检查email
是否实际属于某些domain
或某些smtp
。
我试过这个nslookup
。
<?php
// Function to check whether a given hostName is a valid email
// domain address.
function myCheckDNSRR($hostName, $recType = '')
{
if(!empty($hostName)) {
if( $recType == '' ) $recType = "MX";
exec("nslookup -type=$recType $hostName", $result);
// check each line to find the one that starts with the host
// name. If it exists then the function succeeded.
foreach ($result as $line) {
if(eregi("^$hostName",$line)) {
return true;
}
}
// otherwise there was no mail handler for the domain
return false;
}
return false;
}
// If you are running this test on a Windows machine, you'll need to
// uncomment the next line and comment out the checkdnsrr call:
//if (myCheckDNSRR("joemarini.com","MX"))
if (checkdnsrr("dilip","MX")) // previously they had joemarini.com","MX"
echo "yup - valid email!";
else
echo "nope - invalid email!";
?>
我从sitepoint
获得了此代码,该代码未达到http://verify-email.org/的水平。
我的问题:code
是否需要进行任何修改以配合本网站的功能http://verify-email.org/