Advertisement
dlucio

PHP eMail Verification

Sep 16th, 2017
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.38 KB | None | 0 0
  1. <?php
  2.  
  3. function emailVerify($email){
  4.     $answer = false;
  5.     if(filter_var($email, FILTER_VALIDATE_EMAIL)){
  6.         // Next check the domain is real.
  7.         $domain = end(explode("@", $email));
  8.         if (checkdnsrr($domain), 'MX'){
  9.             $answer = true;
  10.         }
  11.         else{
  12.             if ((checkdnsrr($domain, 'A')) or (checkdnsrr($domain, 'AAAA')) or (checkdnsrr($domain, 'A6'))){
  13.                 $answer = true
  14.             }
  15.         }
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement