Email Verification

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shalinikonatam
    New Member
    • Sep 2007
    • 10

    #1

    Email Verification

    Can any one help me?
    how to verify weather the Email actually exist or not?
    Thanks in Advance.
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    Originally posted by shalinikonatam
    Can any one help me?
    how to verify weather the Email actually exist or not?
    Thanks in Advance.
    there's no code that allows you to do this, otherwise spammers would have a field day.

    did you google this question? no?




    cuz i found that, along with 20 questions posted.


    [PHP]
    function google($yourQ)
    {
    if ($yourAnswer == NULL)
    {
    echo "Help! no answer on google";
    }
    else
    {
    $you = $bangHeader->Table * 100;
    return $you;
    }

    }
    [/PHP]
    google("Email Verification Exists");

    Comment

    • Markus
      Recognized Expert Expert
      • Jun 2007
      • 6092

      #3
      Originally posted by dlite922
      there's no code that allows you to do this, otherwise spammers would have a field day.

      did you google this question? no?




      cuz i found that, along with 20 questions posted.


      [PHP]
      function google($yourQ)
      {
      if ($yourAnswer == NULL)
      {
      echo "Help! no answer on google";
      }
      else
      {
      $you = $bangHeader->Table * 100;
      return $you;
      }

      }
      [/PHP]
      google("Email Verification Exists");
      HAHA!

      I'm so saving that; use it on a newbie caught in the headlights :D

      To the OP:

      The best way to validate an email is using a regex (regular expression)

      There are soooo many tutorials on the world wide internets, so a simple google search (no headbanging required) will suffice!

      Here's a validation i use:
      [php]
      function validateEmail() {
      global $__errorEmail;
      $email = $_POST['email'];
      $__emailExp = '/^[a-z0-9_\+-]+(\.[a-z0-9_\+-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*\.([a-z]{2,4})$/';

      if(!preg_match( $__emailExp, $email)){
      $__errorEmail = "Invalid Email - Please re-enter.";
      } else {
      return true;
      }
      }
      if(validateEmai l()){
      echo "email is valid";
      } else {
      echo "Come again";
      }
      [/php]

      :)
      [/php]

      Comment

      • nathj
        Recognized Expert Contributor
        • May 2007
        • 937

        #4
        Originally posted by markusn00b
        HAHA!

        I'm so saving that; use it on a newbie caught in the headlights :D

        To the OP:

        The best way to validate an email is using a regex (regular expression)

        There are soooo many tutorials on the world wide internets, so a simple google search (no headbanging required) will suffice!

        Here's a validation i use:
        [php]
        function validateEmail() {
        global $__errorEmail;
        $email = $_POST['email'];
        $__emailExp = '/^[a-z0-9_\+-]+(\.[a-z0-9_\+-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*\.([a-z]{2,4})$/';

        if(!preg_match( $__emailExp, $email)){
        $__errorEmail = "Invali d Email - Please re-enter.";
        } else {
        return true;
        }
        }
        if(validateEmai l()){
        echo "email is valid";
        } else {
        echo "Come again";
        }
        [/php]

        :)
        [/php]
        Hi,

        Tthis is pretty much what I do for email verification. the draw back with this is that is simply checks that the user entered value s in the correct format to be an email address.

        If you then send an email to that address using PHP you can checkt the return of mail() and if this is true it was able to send themail so you can call it good. If it is false then the chances are the email is bad and so you can take steps to remove it from the list.

        I admit thisis not foolproof but it does give you a further option for attempting keep your email list clean. You can of course allow for tolerance to say if the email fails 5 times then remove it. This is a bitmore advaced and you'd need to check the database for each email address as you send the email out.

        I hope this makes sense and I wish you luck with the project.

        Cheers
        nathj

        Comment

        • ak1dnar
          Recognized Expert Top Contributor
          • Jan 2007
          • 1584

          #5
          Guys, try this one too.
          Check DNS records corresponding to a given Internet host name or IP address

          Comment

          Working...