PHP code example of slam / zend-mail-extensions

1. Go to this page and download the library: Download slam/zend-mail-extensions 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/ */

    

slam / zend-mail-extensions example snippets


/**
 * QUIT instruction is disabled by default
 * @see https://github.com/zendframework/zend-mail/pull/117
 *
 * All the Zend defaults options are still available
 * @see https://docs.zendframework.com/zend-mail/transport/smtp-authentication/
 */
$transport = new \Slam\Zend\Mail\Transport\Smtp();

$message = new \Zend\Mail\Message();
$message->setFrom('[email protected]');
$message->addTo('[email protected]');
$message->setSubject('Test');
$message->setBody('Test');

$transport->send($message);

sleep(305);

// $transport will automatically reconnect to the SMTP server
$transport->send($message);