Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/yoozi/email

PHP library to help processing email related tasks, such as a Email Address Parser and etc.
https://github.com/yoozi/email

Last synced: 26 days ago
JSON representation

PHP library to help processing email related tasks, such as a Email Address Parser and etc.

Awesome Lists containing this project

README

        

email
=====

> This library is part of [Project Golem](http://golem.yoozi.cn/), see [yoozi/golem](https://github.com/yoozi/golem) for more info.

PHP libraries to help processing email related tasks, such as a Email Address Parser and etc.

## Installation

The best and easy way to install the Golem package is with [Composer](https://getcomposer.org).

1. Open your composer.json and add the following to the require array:

```
"yoozi/email": "1.0.*"
```

2. Run Composer to install or update the new package dependencies.

```
php composer install
```

or

```
php composer update
```

## Usage

### Email Address Parser

We can use this Parser class to parse an email address.

```php
parser->parse($email);

var_dump($meta);
```

Data returned:

```php
array(5) {
["email"]=>
string(18) "[email protected]"
["local"]=>
string(8) "user"
["domain"]=>
string(9) "gmail.com"
["url"]=>
string(22) "http://mail.google.com"
["listed"]=>
bool(true)
}
```

* email: The email address we are currently parsing.
* local: Local part of this address.
* domain: Domain name of this address.
* url: Url for users to log into the email service.
* listed: Whether this address is listed in the thrid-party email service provider [whitelist](https://github.com/yoozi/golem/blob/master/lib/Yoozi/Email/Address/Parser.php#L28).