This is a small PHP library to parse forwarded email content, inspired by EmailReplyParser.
If you don't use a ClassLoader in your application, just require the provided autoloader:
<?php
require_once 'src/autoload.php';
Simply call the read method with the email content like this:
<?php
$email = EmailForwardParser::read($body);
$from = $email->getFrom();
$to = $email->getTo();
$fromName = $from['name'];
$fromEmail = $from['email'];
$toName = $to['name'];
$toEmail = $to['email'];
$date = $email->getDate(); //DateTime
$subject = $email->getSubject();
$body = $email->getBody();