Giter VIP home page Giter VIP logo

email-check's Introduction

Build Status codecov.io Codacy Badge Latest Stable Version Total Downloads License Donate to this project using Paypal Donate to this project using Patreon

✉️ E-Mail Address Validator for PHP

Warning

The best way to validate an e-mail address is still to send a duplicate opt-in-mail, when the user clicks on the link, it was a valid e-mail address!

Installation

The recommended installation way is through Composer.

$ composer require voku/email-check

Usage:

Example 1:

$emailCheck = EmailCheck::isValid("[email protected]");

// true

Example 2: (check for example-domain)

$emailCheck = EmailCheck::isValid("[email protected]", true);

// false

Example 3: (check for typo in domain)

$emailCheck = EmailCheck::isValid("[email protected]", false, true);

// false

Example 4: (check for temporary-domain)

$emailCheck = EmailCheck::isValid("[email protected]", false, false, true);

// false

Unit Test:

  1. Composer is a prerequisite for running the tests.
composer install
  1. The tests can be executed by running this command from the root directory:
./vendor/bin/phpunit

Support

For support and donations please visit Github | Issues | PayPal | Patreon.

For status updates and release announcements please visit Releases | Twitter | Patreon.

For professional support please contact me.

Thanks

  • Thanks to GitHub (Microsoft) for hosting the code and a good infrastructure including Issues-Managment, etc.
  • Thanks to IntelliJ as they make the best IDEs for PHP and they gave me an open source license for PhpStorm!
  • Thanks to Travis CI for being the most awesome, easiest continous integration tool out there!
  • Thanks to StyleCI for the simple but powerfull code style check.
  • Thanks to PHPStan && Psalm for relly great Static analysis tools and for discover bugs in the code!

email-check's People

Contributors

anhofmann avatar dependabot-support avatar renovate[bot] avatar scrutinizer-auto-fixer avatar voku avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

email-check's Issues

DNS error check only MX Record ?

Wouldn't it be a viable case for a valid email with a correct MX record, but no A-record? Email will be received that way.

It's an edge case, but wouldn't it be more correct to change
return !\checkdnsrr($domain . '.', 'MX') || !\checkdnsrr($domain, 'A');
to
return !\checkdnsrr($domain . '.', 'MX');

in the code here ?

Remove miam.kd2.org

Hi,

please remove miam.kd2.org from your "domainsTemporary.php" file as it is our internal email server, and is not publicly accessible, and does not provide temporary emails either.

Thank you.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

composer
composer.json
  • php >=7.0.0
  • symfony/polyfill-intl-idn ~1.10
  • phpunit/phpunit ~6.0 || ~7.0
  • fzaninotto/faker ~1.7

  • Check this box to trigger a request for Renovate to run again on this repository

Returns valid when Null MX record is set

What is this feature about (expected vs actual behaviour)?

RFC 7505 specifies "null MX" for when a domain explicitly does not support email.

Even if a null MX record is set this check will still return that the address is valid.

How can I reproduce it?

$emailCheck = EmailCheck::isValid("[email protected]", false, false, false,  true);

// expected false
// got true

Does it take minutes, hours or days to fix?

In isDnsError instead of using checkdnsrr it could use dns_get_record and then check the priority.

Any additional information?

Copyright notice?

It looks like you have taken Michael Rushton's regex pattern as used in PHP, but you forgot to add the copyright notice?

 * Michael's regex carries this copyright:

523 *
524 * Copyright © Michael Rushton 2009-10
525 * http://squiloople.com/
526 * Feel free to use and redistribute this code. But please keep this copyright notice.

Make Punycode conversion optional

What is this feature about (expected vs actual behaviour)?

Currently, the isValid callback always converts the local and domain part into Punycode.

However, lots of environments don't support Punycode and we'd like to validate email addresses such that special characters like German umlauts or other accented character would be recognized as invalid.

I'll be posting a PR in a minute to fix this.

Does it take minutes, hours or days to fix?

Minutes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.