Email address format

Solved
Hello everyone,
Does anyone have a website or a document that describes the format of an email address, the rules regarding the address format (firstname.lastname@site.com)
Thank you and see you soon.

5 answers

  1. Moderator
    The precise specification is in paragraph 6.1 of RFC 822:
    http://ietf.org/rfc/rfc0822.txt

    But to put it more simply:

    Allowed characters: a-z 0-9 . _ -
    (case insensitive)
    followed by the at sign (@)
    followed by an existing domain name or subdomain (same allowed characters).
    3
    1. Thank you for this information. Just one more question, spaces in an address are not allowed?
      0
    2. @yomipThank you very much. I got what I wanted.
      Have a nice day and thanks again for the quick response.
      0
  2. Attention, RFC822 is NOT the current RFC for an email address.
    https://tools.ietf.org/html/rfc3696
    and its erratum:
    http://www.rfc-editor.org/cgi-bin/errataSearch.pl?rfc=3696

    Basically, for everything before the @, the following are allowed:
    - letters (uppercase AND lowercase, but it's the server that decides whether it distinguishes or not)
    - numbers
    - characters ! # $ % & ' * + - / = ? ^ _ ` . { | } ~

    Thus, Finances/pole_S&P/Jean.Valjean*flashbang*6+4=10@montfermeil.les-miserables.com is a VALID address.

    It is even possible to use spaces and \ by using quotes: "Jean Valjean"@les-miserables.com is a valid email address.
    -1
    1. Moderator
      Thank you for the clarification.
      0
    2. Oui, les caractères accentués sont autorisés.
      0
    3. Hello,

      No, accented characters are not allowed.

      Good afternoon,
      Alaedyna.
      --
      Don't forget to thank us if you want us to help you.
      × It's a harmful habit to strangle those you prefer. × [ Amélie Nothomb ]
      0
  3. Hello,

    And does anyone have a PHP mask to validate this kind of addresses?

    I made an attempt that I was satisfied with using XSS software and manual attempts
    but it seems that a clever spammer managed to get me...

    Here is my attempt to correct:

     $ident = '[-a-z0-9!#$%&\'*+\\/=?^_`{|}~]'; $domain = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)'; $regex = '/^'.$ident.'+'.'(\.'.$ident.'+)*'.'@'.'('.$domain.'{1,63}\.)+'.$domain.'{2,63}$/i'; if (preg_match($regex, $mail)==false) { return false; } else { return true; } 
    0
    1. Solution on developpez.com dear nlx...

      (you here on howstuffworks.net!!! ^^)
      0
      1. Salut, comment fais-tu pour créer une adresse mail sur Orange ? Merci de m'aider.
        0