Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^3: On Validating Email Addresses

by Thilosophy (Curate)
on Jan 05, 2005 at 01:53 UTC ( [id://419491]=note: print w/replies, xml ) Need Help??


in reply to Re^2: On Validating Email Addresses
in thread On Validating Email Addresses

But really, you're now being too generous. The real solution is to use Email::Valid, which contains a very large and complex regex, plus a few other validation routines.

Well, my point was that you cannot validate the email with a regular expression anyway. You are very unlikely to even catch typos. If my email is bill@microsoft.com and I mistype it as bikk@microsoft.com how is Email::Valid going to help you? So why bother at all?

Concession: Email::Valid can also check if an MX entry exists for the domain. That might make sense in some situations (but it still does not check the user name -- is there a way to do this, too?)

Replies are listed 'Best First'.
Re^4: On Validating Email Addresses
by BrowserUk (Patriarch) on Jan 05, 2005 at 02:11 UTC

    As you suggested, about the best possible check that you can hope to perform for the purposes of catching typos is to ask the user to type it twice.

    The problem with that is that I always copy&paste when I'm asked to do that, so if I type it incorrectly the first time, it just gets confirmed incorrectly.


    Examine what is said, not who speaks.
    Silence betokens consent.
    Love the truth but pardon error.
Re^4: On Validating Email Addresses
by jeffenstein (Hermit) on Jan 10, 2005 at 07:18 UTC
    Ah, but even checking the MX is fraught with danger. What if the name servers are offline for the moment, or the local nameservers are not working, or even that no local nameserver is configured due to security rules? Wait 30 seconds to go to the secondary? Return it as invalid? It's probably much better to send some sort of cookie to the e-mail address to continue, if having an e-mail address really is important.

    As an aside, + is valid in the username portion of the e-mail address, and I try to use it regularly, I really do. However, the only form I've found so far that actually accepts it (without causing problems) is the mailman interface.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://419491]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (1)
As of 2024-04-25 03:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found