in reply to Email::Valid, what am I doing wrong here?

What makes you think the spaces aren't allowed?

To aid in the creation and reading of structured fields, the free insertion of linear-white-space (which permits folding by inclusion of CRLFs) is allowed between lexical tokens.

And "Joe & J. Harvey" <ddd @ Org> is used in an example in the spec.

Replies are listed 'Best First'.
Re^2: Email::Valid, what am I doing wrong here?
by rajivp (Novice) on May 16, 2009 at 07:56 UTC
    Sorry, I had responded without logging in first. I was pretty sure that this (allowing spaces) was intentional on the part of the programmer. My only concern was whther the 'space' was safe enough.

    If I type a space (before or after the @) in the To field of a gmail 'compose' form, it gives me:

    Some addresses in the "To" field were not recognized. Please make sure that all addresses are properly formed.

      And thus we discover one more thing Google does wrong. :) In this case you're talking to an application which has chosen its own limited filter heuristics. Passing the address to any mail transport agent should work. I just checked my own gmail address with extra spaces added sent from mail on the command line and it turned up in my box just fine.

        The reason why Google can do this, and make this rejection useful, if because Gmail is an interactive application. The spaces in an entered email address are indeed likely a mistake by the user, and he's given a chance to fix it, either way.

        But if the address was passed along to a mail server in batch, then it'd better accept it!

Re^2: Email::Valid, what am I doing wrong here?
by Anonymous Monk on May 16, 2009 at 07:32 UTC
    If I type a space (before or after the @) in the To field of a gmail 'compose' form, it gives me:

    Some addresses in the "To" field were not recognized. Please make sure that all addresses are properly formed.

    I was trying to send the mails from a perl script. I assume, that the space would be a problem, if it appears before or after the @ sign