PHP code example of mailboxvalidator / mailboxvalidator-bundle

1. Go to this page and download the library: Download mailboxvalidator/mailboxvalidator-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mailboxvalidator / mailboxvalidator-bundle example snippets


use Symfony\Component\Dotenv\Dotenv;

$dotenv = new Dotenv();
$dotenv->load(__DIR__.'/.env'); //Your .env file path

// config/bundles.php
return [
    ...
    MailboxValidatorBundle\MailboxValidatorBundle::class => ['all' => true],
];

use MailboxValidatorBundle\Validator\MBVSingle;
use MailboxValidatorBundle\Validator\MBVDisposable;
use MailboxValidatorBundle\Validator\MBVFree;

->add('email', EmailType::class, [
			'constraints' => [
				new MBVDisposable([
					//You can also custom a message yourself. For example,
					//'message' => 'This email is disposable. Please enter another email again.',
					]),
				],
			])