繁体   English   中英

有没有办法检测电子邮件地址的假域名? 使用Perl,php,javascript?

[英]Is there a way to detect fake domain name of email address? Using Perl, php, javascript?

如果有人知道我们如何检测电子邮件地址的虚假域名,那将是一个很大的帮助。

请注意,我不想验证电子邮件。 我想知道电子​​邮件域名是否存在。

在PHP中有一个函数checkdnsrr

如何检查域名是否存在?

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

我希望您从电子邮件中提取域名并在此功能中使用它。

文档链接:

http://php.net/manual/en/function.checkdnsrr.php

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM