PHP code example of understeam / yii2-mailgun

1. Go to this page and download the library: Download understeam/yii2-mailgun library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

understeam / yii2-mailgun example snippets


...
'mailer' => [
    'class' => 'understeam\mailgun\Mailer',
    'domain' => 'domain.com',
    'apiKey' => 'api-key',
],
...

$message = Yii::$app->mailer->compose('@common/mail/signup', ['user' => $user]);
$message->send();