PHP code example of peoplefone / mail-validator-mx-server

1. Go to this page and download the library: Download peoplefone/mail-validator-mx-server 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/ */

    

peoplefone / mail-validator-mx-server example snippets




use peoplefone\mailValidatorMXServer;

$class = new mailValidatorMXServer("mydomain.com", "[email protected]");

$class->setContact("[email protected]");
$class->setContact("[email protected]");
$class->setContact("[email protected]");

$result = $class->validate();
print_r($result);

/**
 * Port of the remove MX Server.
 */
$class->setConnectionPort("25");

/**
 * Timeout of each connection.
 */
$class->setConnectionTimeOut("30");

/**
 * Timeout of each communication.
 * Note that some MX servers are configured to wait before responding or respond with multiple lines.
 * Perhaps you need to increase the stream timeout to get successful validation.
 */
$class->setStreamTimeOut("15");

/**
 * Pass the Boolean value TRUE to print the debug log.
 */
$class->validate(true);

$class->setContact("[email protected]");

$class->unsetContact("[email protected]");

$class->getContacts()