-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Konrad Fedorczyk
committed
Mar 22, 2021
1 parent
e849126
commit ca56886
Showing
2 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Change Log | ||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](http://keepachangelog.com/) | ||
and this project adheres to [Semantic Versioning](http://semver.org/). | ||
|
||
## [1.0.3] - 2021-03-22 | ||
|
||
### Added | ||
- Ability to simple check MX records of a domain | ||
|
||
### Changed | ||
|
||
### Fixed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
[![Build Status](https://travis-ci.com/fedek6/tld-mail-validator.svg?token=Fpapy2MXqrwtfsLgfThp&branch=main)](https://travis-ci.com/fedek6/tld-mail-validator) | ||
|
||
PHP e-mail address validator using list of all known [TLDs](https://data.iana.org/TLD/tlds-alpha-by-domain.txt). With ability to automatically update tlds list. | ||
PHP e-mail address validator using list of all known [TLDs](https://data.iana.org/TLD/tlds-alpha-by-domain.txt) and simple domain MX record check. With ability to automatically update top-level domains list. | ||
|
||
## Usage example | ||
|
||
|
@@ -25,6 +25,13 @@ if ($validator->validate('[email protected]')) { | |
} | ||
``` | ||
|
||
If you want to test also MX record of a domain (slower), pass second argument to the constructor: | ||
|
||
```php | ||
/** @var \Fedek6\TldMailValidator\TldMailValidator $validator */ | ||
$validator = new TldMailValidator($tldsFilePath, TldMailValidator::TEST_ALL); | ||
``` | ||
|
||
## Testing | ||
|
||
```bash | ||
|
@@ -42,3 +49,10 @@ Or: | |
```bash | ||
vendor/bin/phpunit --testdox --verbose --colors tests/RemoteFileUpdaterTest.php | ||
``` | ||
|
||
### Dry run before deploy | ||
|
||
```bash | ||
php -f examples/mx.php | ||
php -f examples/simple.php | ||
``` |