Created
February 9, 2013 00:03
-
-
Save adatta02/4743025 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
require_once 'config.php'; | |
require_once('MimeMailParser/MimeMailParser.class.php'); | |
$total = ""; | |
$stdin = fopen('php://stdin', 'r'); | |
while (($buffer = fgets($stdin)) !== false) { | |
$total .= $buffer; | |
} | |
$fname = tempnam(sys_get_temp_dir(), 'hpv'); | |
file_put_contents( $fname, $total ); | |
$Parser = new MimeMailParser(); | |
$Parser->setPath( $fname ); | |
$msgInfo = array( | |
"to" => $Parser->getHeader('to'), | |
"from" => $Parser->getHeader('from'), | |
"subject" => $Parser->getHeader('subject'), | |
"plain_body" => $Parser->getMessageBody('text'), | |
"html_body" => $Parser->getMessageBody('html') | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment