There is no license information available for the latest version (dev-master) of this package.

Yii3 Mailer Services

dev-master / 1.0.x-dev 2020-12-25 13:23 UTC



Mailer services

Total Downloads build codecov Mutation testing badge static analysis type-coverage


The minimum requirement by this project template that your Web server supports PHP 7.4.0.


composer require yii-extension/mailer-service


You can inject mailer-service into the controller or action, and automatically all dependencies are resolved by autowired in di-container.

public function contact(
    MailerService $mailer,
    ServerRequestInterface $request,
): ResponseInterface {
        'test@example.com', // from
        'admin1@example.com', // to
        'TestMe', // subject
        '@mail', // path mail
        [ 'html' => 'contact'], // name layout
        [ // params
            'username' => 'User',
            'body' => 'TestMe',
        $request->getUploadedFiles(), // attach files

Unit testing

The package is tested with PHPUnit. To run tests:


Mutation testing

The package tests are checked with roave-infection-static-analysis-plugin mutation framework. To run it:


Static analysis

The code is statically analyzed with Psalm. To run static analysis: