Yii Framework Swift Mailer Extension
For license information check the LICENSE-file.
The preferred way to install this extension is through composer.
php composer.phar require --prefer-dist yiisoft/yii-swiftmailer
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('firstname.lastname@example.org') ->setTo($form->email) ->setSubject($form->subject) ->send();
For further instructions refer to the related section in the Yii Definitive Guide.