Skip to content

Commit

Permalink
Merge pull request #17 from aman00323/add_disposable_list_in_repo
Browse files Browse the repository at this point in the history
Add local support for disposable domain list
  • Loading branch information
aman00323 authored Apr 28, 2020
2 parents c8c2836 + 51c4789 commit 220e637
Show file tree
Hide file tree
Showing 43 changed files with 25,888 additions and 123 deletions.
45 changes: 45 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ workflows:
jobs:
- php72-laravel58
- php72-laravel58-prefer-lowest
- php73-laravel58
- php73-laravel58-prefer-lowest
- php72-laravel60
- php72-laravel60-prefer-lowest
- php73-laravel60
- php73-laravel60-prefer-lowest

jobs:
php72-laravel58-prefer-lowest:
Expand All @@ -36,3 +42,42 @@ jobs:
steps:
- install_and_test:
laravel: 5.8.*
php73-laravel58-prefer-lowest:
docker:
- image: circleci/php:7.3
steps:
- install_and_test:
laravel: 5.8.*
composer_flags: --prefer-lowest
php73-laravel58:
docker:
- image: circleci/php:7.3
steps:
- install_and_test:
laravel: 5.8.*
php72-laravel60-prefer-lowest:
docker:
- image: circleci/php:7.2
steps:
- install_and_test:
laravel: 6.0.*
composer_flags: --prefer-lowest
php72-laravel60:
docker:
- image: circleci/php:7.2
steps:
- install_and_test:
laravel: 6.0.*
php73-laravel60-prefer-lowest:
docker:
- image: circleci/php:7.3
steps:
- install_and_test:
laravel: 6.0.*
composer_flags: --prefer-lowest
php73-laravel60:
docker:
- image: circleci/php:7.3
steps:
- install_and_test:
laravel: 6.0.*
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vendor/
.phpunit.result.cache
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# CHANGELOG

## 2.2.0
- Disposable domain list are added inside repo instead of gist.
- Refactor helper method and optimize code for performance improvement.
- Add testcases environment for laravel 6 for circle ci.
- New testcases added for Helper.
- Add .gitingore file.
- Add option to set from email address.

## 2.1.0
- Update some character list inside helper.
- New domains added to disposable domain list, Now we have 25K domains list.
Expand Down
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,31 @@ This option is part of checkDisposableEmail() method, you need to pass second ar

When you pass true inside helper will check emails with list of dispossable. which are hosted on gist, So whenever list will be changed you would't have to update package.

```
```php
app(EmailChecker::class)->checkDisposableEmail('something@example.com','boolean'));
```

This email verification will be done on the basis of [disposable emails](https://en.wikipedia.org/wiki/Disposable_email_address) list, This function will check if entered email address is in the list of disposable or not.

### Check DNS And MX Records

*For better output you need to set from email address for this method*

```php
app(EmailChecker::class)->setFromEmail('something@example.com','boolean'));
```

OR
Set ENV variable in your .env
```php
EMAIL_CHECKER_SET_FROM=something@example.com
```

Another usage is to check [DNS](https://en.wikipedia.org/wiki/Domain_Name_System) and [MX Record](https://en.wikipedia.org/wiki/MX_record) of the email address, In this method package will try to extract records from email address and try to verify using [SMTP](https://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol).

If this method will successfully extract records, then it will try to send HELLO message on the email address using [fsockopen()](https://www.php.net/manual/en/function.fsockopen.php), if it get valid status from MAIL server then it will return true. Also function will return true if it is not verify with the detail message.

```
```php
app(EmailChecker::class)->checkMxAndDnsRecord('something@example.com'));
```
This will return array with success and details, Details will indicate email verified with any exception or not.
Expand All @@ -59,7 +71,7 @@ Sometime it is hard to identify that email exist or not based on DNS and MX Reco

This method ensures that email which is given has valid domain.

```
```php
app(EmailChecker::class)->checkDomain('something@example.com'));
```

Expand All @@ -71,7 +83,7 @@ This method will use all of the methods and it gives detail response, if it give

If any of the method will respond with FALSE then will not give detail report.

```
```php
app(EmailChecker::class)->checkEmail('something@example.com','boolean'));
```

Expand Down
Loading

0 comments on commit 220e637

Please sign in to comment.