PHP code example of devmastersbv / smtp-validate-email

1. Go to this page and download the library: Download devmastersbv/smtp-validate-email 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/ */

    

devmastersbv / smtp-validate-email example snippets




use SMTPValidateEmail\SMTPValidateEmail;

$from = '[email protected]';
$email = '[email protected]';

$validator = new SMTPValidateEmail($email, $from);
$smtp_results = $validator->validate();

print_r($smtp_results);




use SMTPValidateEmail\SMTPValidateEmail;

$from = '[email protected]'; // for SMTP FROM:<> command
$emails = array(
    '[email protected]',
    '[email protected]',
    '[email protected]',
    '[email protected]'
);

$validator = new SMTPValidateEmail($emails, $from);
$smtp_results = $validator->validate();

// or passing to the validate() method
// $validator = new SMTPValidateEmail();
// $smtp_results = $validator->validate($emails, $from);

print_r($smtp_results);