Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2004
    Posts
    2

    Unanswered: How to check for a valid e-mail

    Does anybody know if it's possible to check whether the e-mail address is valid or not. If yes then how.
    If not then how can I at least check if the e-mail address is an e-mail address. For example if user types "seriypshick @hotmail.com" It would give them a message that their e-mail address is invalid because of the space. Or in other case a missing "." or missing "@".

    Thank you, Serg

  2. #2
    Join Date
    Oct 2002
    Location
    Plymouth UK
    Posts
    116
    You can test for valid email addresses using the following regex:

    Code:
    eregi("^([a-z0-9]|\\-|\\.)+@(([a-z0-9]|\\-)+\\.)+[a-z]{2,4}$", 
    $email_string);

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •