All pastes #766001 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-11-08 15:19 UTC
rendered paste body
#!/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);


?>