PHP code example of vagrantir / yii2-mailgun

1. Go to this page and download the library: Download vagrantir/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/ */

    

vagrantir / yii2-mailgun example snippets


'components' => [
    ...
    'mailer' => [
        'class' => 'boundstate\mailgun\Mailer',
        'key' => 'key-example',
        'domain' => 'mg.example.com',
    ],
    ...
],

Yii::$app->mailer->compose('contact/html', ['contactForm' => $form])
    ->setFrom('[email protected]')
    ->setTo($form->email)
    ->setSubject($form->subject)
    ->send();

php composer.phar