PHP code example of azt3k / abc-silverstripe-mailer

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

    

azt3k / abc-silverstripe-mailer example snippets


SmtpMailer::set_conf(array(
    'default_from'      => array(
                               'name'  => 'admin',
                               'email' => 'admin@localhost'
                           ),
    'charset_encoding'  => 'utf-8',
    'server'            => 'localhost',
    'port'              => 25,
    'secure'            => null,
    'authenticate'      => false,
    'user'              => 'username',
    'pass'              => 'password',
    'debug'             => 0,
    'lang'              => 'en'
));

SmtpMailer::set_conf(array(
    'default_from'      => array(
                               'name'  => 'user',
                               'email' => '[email protected]'
                           ),
    'charset_encoding'  => 'utf-8',
    'server'            => 'smtp.gmail.com',
    'port'              => 587,
    'secure'            => 'tls',
    'authenticate'      => true,
    'user'              => '[email protected]',
    'pass'              => 'password',
    'debug'             => 0,
    'lang'              => 'en'
));