PHP code example of fluchi / mailgun-handler

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

    

fluchi / mailgun-handler example snippets


use Monolog\Logger;
use MailgunHandler\MailgunHandler;

d on .env config file
$logger->pushHandler(new MailgunHandler('email subject'));

// email WARNING level
$logger->pushHandler(new MailgunHandler('email subject', null, null, Logger::WARNING));

// you can change from and to on parameters 2 and 3, respectivelly
$logger->pushHandler(new MailgunHandler('email subject', '[email protected]', '[email protected]'));