avigail Posted July 15, 2011 Share Posted July 15, 2011 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.. Quote Link to comment https://forums.phpfreaks.com/topic/242030-how-to-validate-an-email-i-nid-your-help-tt/ Share on other sites More sharing options...
btherl Posted July 15, 2011 Share Posted July 15, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/242030-how-to-validate-an-email-i-nid-your-help-tt/#findComment-1242925 Share on other sites More sharing options...
$php_mysql$ Posted July 15, 2011 Share Posted July 15, 2011 i think it could be done, seen it at some place long long back cnt find nw. Check capmarketer.com/check-email-address-exists-sending-email/ Quote Link to comment https://forums.phpfreaks.com/topic/242030-how-to-validate-an-email-i-nid-your-help-tt/#findComment-1242927 Share on other sites More sharing options...
TeNDoLLA Posted July 15, 2011 Share Posted July 15, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/242030-how-to-validate-an-email-i-nid-your-help-tt/#findComment-1243008 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.