• gegil@sopuli.xyz
    link
    fedilink
    arrow-up
    84
    ·
    3 days ago

    The best email validation is just sending an email to whatever provided by the user. If user receives an email and validates it, than its validated.

    • bestboyfriendintheworld@sh.itjust.works
      link
      fedilink
      arrow-up
      2
      arrow-down
      1
      ·
      1 day ago

      Email validation for a form should at most look for

      • at least one character
      • followed by @
      • followed by at least one character
      • followed by .
      • followed by at least two characters

      Sending an email can take a few minutes. Form validation is instant.

      • JohnEdwa@sopuli.xyz
        link
        fedilink
        arrow-up
        2
        ·
        21 hours ago

        Which would still not be perfect because “foo@bar”, “foo@[123.123.123.123]” and “💩 @[IPv6 :::1]” are all technically valid email addresses.

        It looks like the only validation that doesn’t block something valid pretty much would start and end at “It has at least one @ symbol, and something on both sides”.

    • kunaltyagi@programming.dev
      link
      fedilink
      arrow-up
      12
      ·
      2 days ago

      Email address spec is convoluted and this is indeed the best way. Noobs and ninja do it this way, normies try to validate before sending email