PHP code example of leon-for-nix / my-mailer

1. Go to this page and download the library: Download leon-for-nix/my-mailer 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/ */

    

leon-for-nix / my-mailer example snippets




use App\Transport\MailTransport;

$config = [
    'smtp'=>'smtp.gmail.com',
    'port' => 465,
    'encryption'=>'ssl',
    'pathTemplates'=> '/templates/',
    'defaultTemplate'=> '/templates/default.php',
    'username'=>'user',
    'email'=>'[email protected]',
    'password'=> 'pass',
];
$pathLog = '/logs/log.log';

$transport = new MailTransport($config);
$transport->setLogs($pathLog, 'user');

$params = [
    'shopName' => "Apple Shop",
    'item' => "2718",
];
$title = "Your purchase";

$transport->send('order', '[email protected]', 'user', $title, $params);