Thread: Validating email addresses

  1. #1
    Registered User
    Join Date
    Sep 2001

    Question Validating email addresses

    I need to know what is valid for email addresses. I know that all alphabet characters, numbers, underscores, dashes and those @ signs are valid. Is there anything else valid? And should I make the email address all lowercase, I dont think uppercase are valid, but I'm not sure if that makes a difference or not.

    So far my code checks for @@ or .. and if for some reason the user enters this it will say its invalid. I'm guessing that @. or .@ is also invalid.

    Please help. Thanks.

  2. #2
    Registered User
    Join Date
    Sep 2001
    Okay what I would check for are the following... There can only be one @ in the entire email address. And yes @. or .@ is invalid. An address must also end with a .com, .org, .net, etc. all those extensions. There is a fair sized list last time I checked so you may just want to check for it ending with a .<2 or 3 alpha characters here>? Or you can get the list, only problem is if the list increases (which I would not doubt) you will have to make patch updates for the users of your program for every new one. Also I don't think email addresses are valid if they begin with anything but an alpha or numerical character and they cannot have _@ or @_ or @- or -@, etc. Must be numerical or alpha before and after the @ symbol.

    If I am missing anything, please just lemme know! I believe thats all though.
    Use the code Luke.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Spam Filters. ISP based email is dying.
    By Mario F. in forum A Brief History of
    Replies: 14
    Last Post: 03-05-2008, 12:05 PM
  2. Open Source Email Server!
    By andhikacandra in forum Tech Board
    Replies: 2
    Last Post: 10-02-2007, 10:51 PM
  3. Replies: 1
    Last Post: 04-01-2003, 06:02 AM