Home > Enterprise >  php-mime-mail-parser php library return error
php-mime-mail-parser php library return error

Time:08-05

I have download the library by using composer & add this code in php file:

require_once __DIR__.'/vendor/autoload.php';
$parser = new PhpMimeMailParser\Parser();

But it return the error in log file: PHP Fatal error: Uncaught Error: Class 'PhpMimeMailParser\Parser' not found

mailparse extension already installed on my server

CodePudding user response:

I believe the right syntax is

require_once __DIR__.'/vendor/autoload.php'; $parser = new PhpMimeMailParser();

Look at the Reference here.

CodePudding user response:

After some digging i found that it has to be loaded with:

$parser = new eXorus\PhpMimeMailParser\Parser();

you might also need to install mailparse extension and enable it in php.ini

you can find updated usage in:

vendor/php-mime-mail-parser/php-mime-mail-parser/README.md

  • Related