PHP code example of fei / mailer-package

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

    

fei / mailer-package example snippets




use ObjectivePHP\Application\AbstractApplication;
use Fei\Service\Mailer\Package\MailerPackage

class Application extends AbstractApplication
{
    public function init()
    {
        // Define some application steps
        $this->addSteps('bootstrap', 'init', 'auth', 'route', 'rendering');
        
        // Initializations...

        // Plugging the Mailer Package in the bootstrap step
        $this->getStep('bootstrap')
        ->plug(MailerPackage::class);

        // Another initializations...
    }
}


use Fei\Service\Mailer\Package\Config\MailerParam;
use Fei\Service\Mailer\Client\Mailer;
use Fei\Service\Mailer\Package\Config\MailerAsyncTransport;
use Fei\Service\Mailer\Package\Config\MailerTransportOptions;

return [
    new MailerParam([Mailer::OPTION_BASEURL => 'http://mailer.dev:8181']),
    new MailerAsyncTransport('127.0.0.1'),
    new MailerTransportOptions([]),
];

        // Plugging the Mailer Package in the bootstrap step
        $this->getStep('bootstrap')
        ->plug(new MailerPackage('my-service'));