开发者

How to check misspelled email during user registration

开发者 https://www.devze.com 2022-12-23 14:08 出处:网络
I use an email registration and confirmation in my project (yes, I know about OpenID. In my counry, a main email service lacks it).

I use an email registration and confirmation in my project (yes, I know about OpenID. In my counry, a main email service lacks it).

Sometimes users misspell their email addresses. I know about this due to "message could not be delivered" letters in a mailbox. A miss开发者_开发百科pelled address is absolutely correct, because I check it with a regular expression - say, jon.doe@example.com intstead of john.doe@example.com. And I do not want to duplicate a email field in a registration form (who likes it?).

Request processing routine cannot wait for email delivery - it could take an unpredictable time. So, my script will return to user a confirmation message "An email was sent". And the user will wait for it forever (of cause, not - he/she will turn to an alternative project with a more perfect registration system).

Does someone knows how it can be improved (in any programming language)?


If you cannot wait for a response back from a confirmation e-mail, I would display a yes/no message box confirming their e-mail (i.e Send e-mail to jon.doe@example.com?) before sending the e-mail. While your at it, you can check to see if the e-mail is a duplicate as well.

If no duplicate found and they click "Yes" then send the e-mail. If not, ask them to re-enter the e-mail address.

With this approach you have gone above and beyond validating correct e-mail addresses since there are no services that will explicitly check for correct/valid addresses.


Unfortunately, there's no canonical way to spell anything in an e-mail address and no way to check programmatically whether it's spelled correctly or not. The only tool that can confirm the correctness of a valid e-mail address is Eyeball 1.0, which runs client side.


You can try the SMTP VRFY on the server but most won't reply with anything valuable. Most will simply say "go ahead and try it" because returning something useful would be invaluable to spammers.


You can always check the domain name with a DNS lookup but the only way to check an email address is to send a message.

Try to have the user type his email twice with an email confirmation field (as for the password).

EDIT : Anthony's idea is good too.


For user parts of email the only thing I can think of is using:

  • MX lookups (if mail provider doesn't block them... since that can be abused to filter email lists)
  • Requiring user to enter email twice to ensure he doesn't misspell user portion of email

As for domain part of email, take a look at this:

AngularJs directive to offer suggestions for misspelled emails?

It helped me to reduce bounce for misspellings like gmai.com and gmail.con.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号