2017 © Pedro Peláez
 

library email

A simple email value object for your projects

image

black/email

A simple email value object for your projects

  • Friday, October 7, 2016
  • by pocky
  • Repository
  • 1 Watchers
  • 0 Stars
  • 197 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 2 % Grown

The README.md

Email

PHP 5.4+ library to make working with Email safer, easier, and fun!, (*1)

SensioLabsInsight Build Status Scrutinizer Quality Score Latest Stable Version Total Downloads, (*2)

Installation

The recommended way to install Email is through Composer:, (*3)

{
    "require": {
        "black/email": "@stable"
    }
}

Protip: You should browse the black/email page to choose a stable version to use, avoid the @stable meta constraint., (*4)

Usage

Usage is simple. Just create a new EmailEmail, if your email is invalid an Email\Exception\InvalidEmailEmailException will be thrown. Be aware of this, the validation is on the format, not on a A or MX record in a valid DNS., (*5)

$email = new Email\EmailEmail("foo@bar.com");
$email->getValue(); // return foot@bar.com
$email->getValueAsArray() // return ['recipient' => "foo", 'domain' => "bar", 'tld' => "com"]

List of available getters, (*6)

  • getValue()
  • getValueAsArray()
  • getRecipient()
  • getDomain()
  • getTld()

Check if two email are equals, (*7)

isEqualTo(Email\EmailEmail $email): Check if two emails are equals, (*8)

WARNING, (*9)

FILTER_VALIDATE_EMAIL will not works with non-standard ASCII characters so an email like this me@domain.中国 will throw an InvalidEmailAddressException., (*10)

FILTER_VALIDATE_EMAIL don't know rules of providers. 0me@hotmail.com is invalid for hotmail but valid for PHP., (*11)

License

Email is released under the MIT License. See the bundled LICENSE file for details., (*12)

Contributing

See CONTRIBUTING file., (*13)

Credits

This README is heavily inspired by Geocoder library by the great @willdurand. This guy needs your PR for the sake of the REST in PHP., (*14)

Alexandre "pocky" Balmes alexandre@lablackroom.com. Send me Flattrs if you love my work, [buy me gift][9] or hire me!, (*15)

The Versions

07/10 2016

dev-master

9999999-dev http://www.lablackroom.com

A simple email value object for your projects

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

email library black-project value-object

07/10 2016

v1.2

1.2.0.0 http://www.lablackroom.com

A simple email value object for your projects

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

email library black-project value-object

23/05 2015

v1.1.0

1.1.0.0 http://www.lablackroom.com

A simple email value object for your projects

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

email library black-project value-object

22/10 2014

v1.0.0

1.0.0.0 http://www.lablackroom.com

A simple email value object for your projects

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

email library black-project value-object