Coder Social home page Coder Social logo

dbbk / is-biz-mail-php Goto Github PK

View Code? Open in Web Editor NEW

This project forked from salaros/is-biz-mail-php

0.0 0.0 0.0 335 KB

isBizMail tells you whether a given email address belongs to a free email account provider (gmail.com, yahoo.es, yandex.ru etc) or not.

Home Page: https://codecave.pro/#projects

License: Other

PHP 97.53% Makefile 2.47%

is-biz-mail-php's Introduction

Business Email Checker Build Status Coverage Status Scrutinizer Code Quality

License PHP version Latest Stable Version Total Downloads composer.lock available

Donate Patreon Donate Paypal Donate Liberapay

isBizMail tells you whether a given email address is free (gmail.com, yahoo.es, yandex.ru etc) or not. The list of emails used by isBizMail is taken from hereยน. Detects around 2500 domains and subdomains.

  1. All credits for the list itself go to SpamAssasin authors and contributors

Looking for JavaScript, .NET etc?

๐ŸŸŠ๐ŸŸŠ๐ŸŸŠ Support this project ๐ŸŸŠ๐ŸŸŠ๐ŸŸŠ

You can support us in a small way, please consider starring and sharing this repo! It helps us getting known and grow the community.

star us

Installation

You can install isBizMail via Composer:

composer require salaros/is-biz-mail

or by adding it directly to your composer.json file:

{
    "require": {
        "salaros/is-biz-mail": "*"
    }
}

Then use it like this:

<?php

require 'path/to/vendor/autoload.php';

use Salaros\Email\IsBizMail;

(new IsBizMail())->isValid('[email protected]');      // true

// You can use static access as well
IsBizMail::isValid('[email protected]');          // false
// ...

You can easily drop it into your Yii2 model's rules:

public function rules() {
  return [
    // ...
    [['email'], 'isBusinessEmail'],
    // ...
  ];
}

public function isBusinessEmail($attributeName, $params) {
  $isBussiness = (new IsBizMail())->isValid($this->email);
  if (!isBussiness)
    $this->addError($attributeName, 'Mail boxes such as @gmail.com, @yahoo.com etc are not allowed!');
  return $isBussiness;
}

Testing: PHPUnit

composer install
composer test   # or ./vendor/bin/phpunit

is-biz-mail-php's People

Contributors

norkunas avatar peter279k avatar salaros avatar stof avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.