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

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.

Packagist Version Total Downloads License

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.