In php, there is such a function checkdnsrr to verify that dns can be accessed to check whether the email address exists.
*/
The code is as follows: |
Copy code |
$ Email = "abc@111cn.net "; $ Check_email = checkdnsrr ($ email, ""); If ($ check_email ){ Return true; } Else { Return false; } |
/*
Checkdnsrr function description
Bool checkdnsrr (string $ host [, string $ type = "mx"])
Checkdnsrr. Check the dns record of the specified URL
<? Php
The code is as follows: |
Copy code |
// This will not work If (checkdnsrr ("round-robin-example.com"), "all ")){ Return true; } Else { Return false; } // But every value other than "any" will work If (checkdnsrr ("round-robin-example.com"), "")){ Return true; } Else { Return false; } |
The specified host can be a network address or a machine name ). The type parameter can be omitted. The internal value is mx. The value of type can be one of the following: a, mx, ns, soa, ptr, cname, or any. If the dns field of the specified URL is found, true is returned. If the specified dns field is not found or an error occurs, false is returned.