簡體   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