Mailgun mailer for Yii 2 framework.
Via Composer
$ composer require ninjacto/yii2-mailgun
'components' => [
...
'mailer' => [
'class' => 'ninjacto\yii2mailgun\Mailer',
'domain' => 'example.com',
'key' => 'key-somekey',
'tags' => ['yii'],
'enableTracking' => false,
],
...
],
?>
Once the extension is installed, simply use it in your code by :
<?php
Yii::$app->mailer->compose('<view_name>', <option>)
->setFrom("<from email>")
->setTo("<to email>")
->setSubject("<subject>")
// ->setHtmlBody("<b> Hello User </b>")
// ->setTextBody("Hello User")
->send();
?>
Please see CHANGELOG for more information what has changed recently.
$ composer test
Please see CONTRIBUTING and CONDUCT for details.
If you discover any security related issues, please email ramin.farmani@gmail.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.