This begs the question: "Why are you attempting to validate an email address"?

You wish to ensure that the user has typed his email address correctly because:

  1. As a service to your users--if they mistyped it, they will not receieve the information they have asked you for.

    If they really want that information, they will type it correctly.

  2. As a service to yourself--you wish to ensure that you can send them emails, before you allow them to progress to using your service.

    You don't wish to allow them to use your "service" (or have access to your information) without your being able to spa^H^H^H send them your very important and useful information.

    Again, if they want to receive whatever information you want to send them, they will type their email correctly.

    If they do not want to receive it, then typing some spurious addy, like a@b.com, will satisfy most simplistic checks. I don't know which poor blighter has the email addy a@b.com, but they must recieve a sh^H^H lot of junk they never asked for.

    If it is really commercially necessary to restrict your info/service to only those people that you can spam, the only(?) way, is to only provide access, once you recieve a confirmation to an email sent to the address supplied.

    Even this is easily bypassed by those that don't wish to receive "further correspondance", once they have satisfied your requirements.

  3. Other?

I first encountered this concept so loved by marketing people at Tandy/RadioShack. I was asked for my (land) address "before the till would accept my payment". As it happened, I was 3,500 miles from home at the time--which I explained.

"But the till won't accept payment without an address", I was told. "Where are you staying?".

"I don't know the address. I know how to get there, it was the first motel I encountered leaving the airport, but what the address is I have no idea. Hell, I'm not even sure what the name of the place is!".

"I have to have an address before I can complete the transaction".

"Okay, if any address will do, put your address in".

"Oh! I can't so that...".

Okay, please wait a minute while I check the address"..{I disappeared out of the shop for a couple of minutes}..."Okay. It's 7125"

"7125"

"1st Street"

"First Street".

"Utah"

"And the zip code?"

"Sorry, I don't know the zipcode".

"Okay, it should be able to look it....Hang on. That's the address of this shop!?".

"Did the till accept it?"

"Erm...Yes".

"Great! We're done then".


Examine what is said, not who speaks.
Silence betokens consent.
Love the truth but pardon error.

In reply to Re: On Validating Email Addresses by BrowserUk
in thread On Validating Email Addresses by dws

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.