Skip to content

Latest commit

 

History

History
41 lines (27 loc) · 969 Bytes

README.md

File metadata and controls

41 lines (27 loc) · 969 Bytes

Bounce email parser

How to install with Composer

To install this library, run the command below and you will get the latest version

composer require sbknk/php-bounce-mail-parser

How to use it

<?php

// Initialize compser autoloader
require_once __DIR__ . '/vendor/autoload.php';

$parser = new \PhpBounceMailParser\Parser();

// You can specify a directory
$parser->parseDirectory('path/to/directory');

// or a single file (e.g. *.eml)
$parser->parseFile('path/to/file');

// Specify emails to be ignored when trying to find the recipient as follows
$parser->ignoreEmail('[email protected]');

// Finally get the data output directly in the browser
$parser->outputCsv();

// or as file download
$parser->saveCsvAs();

// Here is a complete working example
$parser = new \PhpBounceMailParser\Parser();
$parser->ignoreEmail('[email protected]')
       ->parseDirectory(__DIR__ . '/resources')
       ->outputCsv();

?>