Jump to content

Recommended Posts

how will i know if the email address entered by the user when he/she registered is a valid email. ? if that email is also registered for example in yahoo, gmail,etc. . and it will return false if it is not registered.. i want to have the exact code for  this.. i hope that you will reply to this message..  :confused:

The short answer is that you can't tell.  Otherwise spammers would abuse this to find valid email addresses.

 

You can check if an email looks valid, and you can try sending an email to that address and see what happens.  If you really need valid email addresses, send an activation email with a unique link and ask the owner to follow the link.

If you are using PHP 5 >= 5.2.0 you could use filter_var() http://fi2.php.net/manual/en/function.filter-var.php with a flag FILTER_VALIDATE_EMAIL. Or if you need to validate it more specifically then maybe using regexp is the way. But as btherl already said, its super hard to try to validate emails in all cases. Either you let in some false emails or you end up blocking valid emails or both. As mentioned the activation link method is most bulletproof.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.