[Nottingham] Just how complicated can email addresses be?!

Martin martin at ml1.co.uk
Tue Oct 5 22:30:32 UTC 2010


Folks,

OK, so I thought checking for a valid email address would be easy enough...

There's the (rather incomplete) case filtered by the regular expression:

[a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}

In php, there's the function:

filter_var(email_address, FILTER_VALIDATE_EMAIL)

for which there's no detail as to what/how the filter actually filters...


And then there is:

Develop a working PHP function to validate e-mail addresses
http://www.linuxjournal.com/article/9585

Phew! Follow that lot?!

I think the best comment there is to do a DNS lookup on the domain and
let the destination sort out whether the local (recipient) name makes
sense or not!


How did that lot get to be so arcane?!

Which brings me onto a small problem with escaping characters in php's
mail function... (Next posting!)

Cheers,
Martin

-- 
----------------
Martin Lomas
martin at ml1.co.uk
----------------



More information about the Nottingham mailing list