PHP code example of vivlong / phalapi-xmailer

1. Go to this page and download the library: Download vivlong/phalapi-xmailer 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/ */

    

vivlong / phalapi-xmailer example snippets


    'Xmailer' => array(
        'email' => array(
            'host' => 'smtp.gmail.com',
            'port' => 465,
            'SMTPSecure' => 'SSL',
            'username' => '[email protected]',
            'password' => '******',
            'from' => '[email protected]',
            'fromName' => 'PhalApi团队',
            'sign' => '<br/><br/>请不要回复此邮件,谢谢!<br/><br/>-- PhalApi团队敬上 ',
        ),
    ),

$di->mailer = function() {
    return new \PhalApi\Xmailer\Lite();
};

\PhalApi\DI()->mailer->send('[email protected]', 'Test PHPMailer Lite', 'something here ...');

$addresses = array('[email protected]', '[email protected]');
\PhalApi\DI()->mailer->send($addresses, 'Test PHPMailer Lite', 'something here ...');