iamiamp / yii2-mailgun
Mailgun integration for the Yii framework
Package info
github.com/EddieZhao/yii2-mailgun
Type:yii2-extension
pkg:composer/iamiamp/yii2-mailgun
v0.0.1
2015-05-12 07:29 UTC
Requires
- mailgun/mailgun-php: ~1.8
- yiisoft/yii2: >=2.0.4
This package is not auto-updated.
Last update: 2026-02-19 02:01:14 UTC
README
Mailgun integration for the Yii framework
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist boundstate/yii2-mailgun "*"
or add
"boundstate/yii2-mailgun": "*"
to the require section of your composer.json file.
Usage
Configure it in the application configuration:
'components' => [ ... 'mailer' => [ 'class' => 'boundstate\mailgun\Mailer', 'key' => 'key-example', 'domain' => 'mg.example.com', ], ... ],
To send an email, you may use the following code:
Yii::$app->mailer->compose('contact/html', ['contactForm' => $form]) ->setFrom('from@domain.com') ->setTo($form->email) ->setSubject($form->subject) ->send();