PHP code example of morrislaptop / error-tracker-adapter-email

1. Go to this page and download the library: Download morrislaptop/error-tracker-adapter-email 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/ */

    

morrislaptop / error-tracker-adapter-email example snippets




// Setup dependencies (much easier with a IoC container)
$transport = new Swift_SendmailTransport();
$mailer = new Swift_Mailer($transport);
$message = new Swift_Message();
$message->addTo('[email protected]');
$message->setFrom('[email protected]');
$body = new Body(new VarCloner(), new CliDumper());
$compiler = new Compiler(new CommonMarkConverter(), new CssToInlineStyles());

// Create reporter
$email = new Email($mailer, $message, $body, $compiler);

// Act.
$exception = new DomainException('Testing a domain exception');
$email->report($exception, ['only' => 'testing', 'user' => Session::all()]);