PHP code example of hahalo / php-mailer

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

    

hahalo / php-mailer example snippets




$transport = new \Hahalo\Mailer\SMTPTransport(
    [
        'host' => 'smtp.gmail.com',
        'port' => 465,
        'encryption' => 'ssl',
        'username' => 'your username',
        'password' => 'your password',
        
        'httpProxy' => 'http://proxy.com:8080' //user http proxy
    ]
);

$mailer = new \Hahalo\Mailer\Mailer($transport);
$mailer->setFrom('[email protected]')
    ->setTo('[email protected]')
    ->setSubject('subject')
    ->setText('email from php mailer')
    ->send();

shell
composer