Code Snippets

Check Valid Email Address – PHP Code Snippet

Comments (6)
    1. Carbonize says:

      All you are doing there is checking if the domain used in the email address exists and accepts email. It doesn’t prove that the email address in question actually exists. May as well just use filter_var or regex and save on the resources.

  1. Alex says:

    Note that you need to have a subdomain of a top domain or whatever its called.

    This does not work: foo@bar
    This works: foo@bar.baz

    1. Carbonize says:

      Yes filter_var does not allow some addresses that are perfectly valid according to the RFC specs. foo@bar is actually a valid email address.

    2. I had the problem this week : with the mail “tester@customer-ä.de” … so I will use a regex next time.

  2. Carbonize says:

    Might as well of just posted a link to the PHP page about using filter_var. You don’t even list the available options nor do you mention any of the issues that come with using filter_var.

Leave a Reply

Your email address will not be published. Required fields are marked *