Jump to content

Does It Make Sense to Have the PHP Email Validation Stricter?


Recommended Posts

This question may be a bit philosophical. As of now I am trying to use:

 

filter_var($email_address, FILTER_VALIDATE_EMAIL)

 

Though in my opinion it allows a bit too much. Then again, is it necessary to have a strict email validation, what is your take on this?

 

It does allow:

 

&&&lol@lol.com

And also: 

blub@blub.conyon

 

I do not know if there are email services which even allow an email like the first one, and I also found out that the validation also does not check for the extension of the email, then again, how necessary is it, and how good can you check for it?

 

What are your suggestions on this one?

It is a valid email, either or, according to the RFC standards.

 

The real goal is, to send a validation email and make them click a "link" to activate their account. This weeds out random email addresses that are bad.

Premiso, I thought about this and I think you are right.

 

The programmers of these functions try to go by what makes sense, which I am glad about, and as you said it is a valid email nevertheless by the standards, thus creating a too strict function would work against this. Checking for the @ and the dot at the extension, and also to certain special characters in this case so that the email validates to the standards would be enough in this case.

 

They do follow procedures the way it is meant to be, which I am glad about as said.

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.