PHP code example of lukeyouell / craft-emailvalidator

1. Go to this page and download the library: Download lukeyouell/craft-emailvalidator 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/ */

    

lukeyouell / craft-emailvalidator example snippets




return [
    'typoCheck'          => true,
    'allowNoMX'          => false,
    'allowCatchAll'      => true,
    'allowRoles'         => true,
    'allowFree'          => true,
    'allowDisposable'    => false,
    // Contact Form plugin settings
    'cfValidation'       => true,
    'cf_allowNoMX'       => false,
    'cf_allowCatchAll'   => true,
    'cf_allowRoles'      => true,
    'cf_allowFree'       => true,
    'cf_allowDisposable' => false,
];

use lukeyouell\emailvalidator\EmailValidator;

EmailValidator::getInstance()->validationService->validateEmail('[email protected]');
twig
{% set validation = validateEmail('[email protected]') %}

<pre>{{ validation|json_encode(constant('JSON_PRETTY_PRINT')) }}</pre>