Yii Framework Swift Mailer Extension
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
config Fix tests (#4) Dec 24, 2018
src Fix tests (#4) Dec 24, 2018
tests
.editorconfig
.gitattributes Added issue templates Mar 21, 2016
.gitignore added Makefile for docker based build May 3, 2015
.travis.yml Fix tests (#4) Dec 24, 2018
CHANGELOG.md Adjusted constraints and version usage Aug 5, 2018
LICENSE.md obsolete 'asset-packagist.org' reference removed Feb 28, 2018
README.md
UPGRADE.md Adjusted constraints and version usage Aug 5, 2018
composer.json
phpunit.xml.dist move source code to 'src' directory Jan 31, 2018

README.md

Yii Framework Swift Mailer Extension


This extension provides a SwiftMailer mail solution for Yii framework.

For license information check the LICENSE-file.

Latest Stable Version Total Downloads Build Status

Installation

The preferred way to install this extension is through composer.

php composer.phar require --prefer-dist yiisoft/yii-swiftmailer

Usage

To use this extension, simply add the following code in your application configuration:

return [
    //....
    'mailer' => [
        '__class' => yii\swiftmailer\Mailer::class,
    ],
];

You can then send an email as follows:

$app->get('mailer')->compose('contact/html')
     ->setFrom('from@domain.com')
     ->setTo($form->email)
     ->setSubject($form->subject)
     ->send();

For further instructions refer to the related section in the Yii Definitive Guide.