如果有人知道如何检测电子邮件地址的假域名,这将是一个很大的帮助。
请注意,我不想验证电子邮件。我想知道电子邮件域名是否存在。
发布于 2013-12-06 19:02:55
在php中有一个函数checkdnsrr
How do you check if a domain name exists?
if (checkdnsrr('test.nl', 'A')) // or use ANY or for other see above link
{
echo 'Domain exists';
}
else
{
echo 'Domain does not exist';
} <?php
if (checkdnsrr('google.com', 'A')) // or use ANY or for other see above link
{
echo 'Domain exists';
}
else
{
echo 'Domain does not exist';
}
?>
//Output = Domain exists//
if (checkdnsrr('fakewebtesting.com', 'A')) // or use ANY or for other see above link
{
echo 'Domain exists';
}
else
{
echo 'Domain does not exist';
}
?>
//Output = Domain does not exists我希望您从电子邮件中提取域名,并在此功能中使用它。
文档链接:
https://stackoverflow.com/questions/20422150
复制相似问题