drupal/core/vendor/egulias/email-validator
Nathaniel Catchpole 3b945fe250 Issue #2366043 by dawehner: Upgrade to Symfony 2.6 2014-11-18 11:26:57 +00:00
..
documentation Issue #2313669 by dawehner, hussainweb, pfrenssen: Bring in egulias/EmailValidator for RFC compliant email address validation. 2014-09-22 23:01:44 +01:00
src/Egulias/EmailValidator Issue #2366043 by dawehner: Upgrade to Symfony 2.6 2014-11-18 11:26:57 +00:00
tests Issue #2366043 by dawehner: Upgrade to Symfony 2.6 2014-11-18 11:26:57 +00:00
.coveralls.yml Issue #2313669 by dawehner, hussainweb, pfrenssen: Bring in egulias/EmailValidator for RFC compliant email address validation. 2014-09-22 23:01:44 +01:00
.travis.yml Issue #2313669 by dawehner, hussainweb, pfrenssen: Bring in egulias/EmailValidator for RFC compliant email address validation. 2014-09-22 23:01:44 +01:00
LICENSE Issue #2313669 by dawehner, hussainweb, pfrenssen: Bring in egulias/EmailValidator for RFC compliant email address validation. 2014-09-22 23:01:44 +01:00
README.md Issue #2366043 by dawehner: Upgrade to Symfony 2.6 2014-11-18 11:26:57 +00:00
composer.json Issue #2366043 by dawehner: Upgrade to Symfony 2.6 2014-11-18 11:26:57 +00:00
composer.lock Issue #2366043 by dawehner: Upgrade to Symfony 2.6 2014-11-18 11:26:57 +00:00
phpunit.xml.dist Issue #2313669 by dawehner, hussainweb, pfrenssen: Bring in egulias/EmailValidator for RFC compliant email address validation. 2014-09-22 23:01:44 +01:00

README.md

EmailValidator Build Status Coverage Status SensioLabsInsightScrutinizer Code Quality

##Installation##

Run the command below to install via Composer

composer require egulias/email-validator

##Usage##

Simple example:

<?php

use Egulias\EmailValidator\EmailValidator;

$validator = new EmailValidator;
if ($validator->isValid($email)) {
	echo $email . ' is a valid email address';
}

More advanced example (returns detailed diagnostic error codes):

<?php

use Egulias\EmailValidator\EmailValidator;

$validator = new EmailValidator;
$email = 'dominic@sayers.cc';
$result = $validator->isValid($email);

if ($result) {
	echo $email . ' is a valid email address';
} else if ($validator->hasWarnings()) {
	echo 'Warning! ' . $email . ' has unusual/deprecated features (result code ' . var_export($validator->getWarnings(), true) . ')';
} else {
	echo $email . ' is not a valid email address (result code ' . $validator->getError() . ')';
}

##Contributors## As this is a port from another library and work, here are other people related to the previous:

  • Ricard Clau @ricardclau: Performance against PHP built-in filter_var
  • Josepf Bielawski @stloyd: For its first re-work of Dominic's lib
  • Dominic Sayers @dominicsayers: The original isemail function

##License## Released under the MIT License attached with this code.