This is a PHP port of email-forward-parser by Crisp OSS.
All credit goes to them.
composer require stechstudio/email-forward-parser
use STS\EmailForward\Parser;
$parser = new Parser();
$result = $parser->read($emailBody, $emailSubject);
echo $result['forwarded']; // true
echo $result['email']['from']['address']; // john.doe@acme.com
See https://github.com/crisp-oss/email-forward-parser/blob/master/README.md for more usage examples.
MIT