How about a perl script that reads STDIN for the Email text, and then forward to a php CGI via a POST method.
use strict;
use warnings;
use LWP::UserAgent;
use HTTP::Request;
# get email from STDIN
my $email = do { local $/; <STDIN> };
# do the parsing of EMAIL here...
# ...
# build variables to pass to PHP via post
# var1, var2 are CGI variables
my %vars = (
var1 => $var1,
var2 => $var2,
# ...
);
# send the POST to php
my $url = "http://server/cgi-bin/script.php";
my $us = new HTTP::Request;
my $res = $us->post($url, \%vars);