devmuhammad / company-email-validator
A fast and efficient company/work email validator that checks if an email domain belongs to a free email provider.
v1.0.2
2025-03-15 14:06 UTC
Requires
- php: ^8.2
Requires (Dev)
- pestphp/pest: 3.x-dev
This package is auto-updated.
Last update: 2025-06-15 14:43:58 UTC
README
A fast and efficient company/work email validator that checks if an email domain belongs to a free email provider.
Installation
Install via Composer:
composer require devmuhammad/company-email-validator
Usage
Validate a single email
use Muhammad\CompanyEmailValidator\EmailValidator; $validator = new EmailValidator(); $validator->isCompanyEmail("test@utterly.app"); //true $validator->isCompanyEmail("test@gmail.com"); //false
Validate multiple emails
use Muhammad\CompanyEmailValidator\EmailValidator; $validator = new EmailValidator(); $validator->areCompanyEmails(["test@utterly.app", "test@gmail.com"]); Output(array): [ "test@utterly.app" => true, "test@gmail.com" => false ]
Validate emails against a custom free domain list
use Muhammad\CompanyEmailValidator\EmailValidator; $email = "user@customfree.com"; $validator = new EmailValidator(['customfree.com']); $validator->isCompanyEmail($email); //false
Contribution
Contributions are welcome! Feel free to submit an issue or a pull request.
Check the LICENSE
file for more info.