PHP FILTER_VALIDATE_EMAIL max length

php

Solution

If the email is really valid then it should work fine with your 200+ character email data. Are you sure you are providing a valid email?

Conditions for a valid email:

The maximum length of an email address is 254 characters.

Every email address is composed of two parts. The local part comes before the '@' sign, and the domain part follows it. In "user@example.com", the local part is "user", and the domain part is "example.com".

The local part must not exceed 64 characters and

the domain part cannot be longer than 255 characters;

the total combined length of all characters (including '@' and punctuation) must not exceed 254 characters, however.

In sum, an email address can be 254 characters long at most. When you create an address, make sure your user name has less than 65 characters (provided the domain is 188 characters long at most).

Problem

What is the maximum length of characters allowed when using PHP's `FILTER_VALIDATE_EMAIL`? I am testing my script to test my function of maximum length allowed(200), but when I use an email over 200 characters PHP's `FILTER_VALIDATE_EMAIL` returns false.

Original source