Anonymous
public text v1 · immutable#!/usr/bin/php -q
<?php
// Send
$fd = fopen("php://stdin", "r");
$email = "";
while (!feof($fd)) {
$email .= fread($fd, 1024);
}
fclose($fd);
$outFile = fopen("test.txt","w");
$subject = strstr($email, 'Subject:');
list($subject, $subjectcontent) = explode(":", $subject);
fwrite($outFile,$email);
fclose($outFile);
mail('bla@bla.com','test subject', $subject);
?>