What is the best PHP email address validation class? #email address validation
Edit
by Segun Olateju - 9 years ago (2015-09-16)
Check if an email address exists
| I need a PHP and AJAX script to check if email address exist on gmail, Yahoo and other domains. |
- 1 Clarification request
1.
by Alpesh Koyani - 5 years ago (2019-07-18) Reply
Ask clarification
1 Recommendation
PHP Email validation: Determine if a given e-mail address is valid.
Class that may be used to determine if a given e-mail address is valid. It features:
- Simple validation just by looking at the e-mail address string
- Validation of the domain against a list of known domains that are often misspelled (typos) like those of Gmail.com, Hotmail.com, Mail.ru, Ntlworld.com, Rediffmail.com, Rocketmail.com, Yahoo.com, Yandex.com, etc.
- Provides did you mean like suggestions for email addresses that were entered with typos
- Validation of domain against a list of typical fake domains like test.com, testtest.com, asd.com, asdf.com, etc..
- Validation of the email address domain against a list of of known domains for being used as disposable email addresses or temporary domains
- Manual whitelisting of domains to avoid trigger false positives of invalid domains
- Validation of the e-mail address domain checking the DNS MX record (mail exchange)
- Validation of a e-mail address by connecting to the mail host server to determine if there is really a deliverable mail box by simulating part of the message delivery process.
| by Manuel Lemos package author 26695 - 9 years ago (2015-09-21) Comment
This class can perform email validation by several methods, including simulating a delivery attempt to the destination SMTP server.
It may not be sufficient for some cases of servers that accept all messages and only bounce them later but it can help you detect many invalid addresses including some that the user typed incorrectly.
Here is an article explaining how the email validation works. |