PHP code example of voronkovich / phpmailer-dsn

1. Go to this page and download the library: Download voronkovich/phpmailer-dsn 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/ */

    

voronkovich / phpmailer-dsn example snippets


use Voronkovich\PHPMailerDSN\DSNConfigurator;
use PHPMailer\PHPMailer\PHPMailer;

$mailer = new PHPMailer(true);
$configurator = new DSNConfigurator();

$configurator->configure($mailer, 'smtp://localhost:2525');

$dsn = 'mail://localhost?XMailer=SuperMailer&FromName=CoolSite';

$configurator->configure($mailer, $dsn);

$dsn = 'sendmail://localhost?Sendmail=/usr/sbin/sendmail%20-oi%20-t';

$configurator->configure($mailer, $dsn);