1

I have emails piped to a PHP script, which looks like this:

#!/usr/local/bin/php -q
<?php

// read from stdin
$fd = fopen("php://stdin", "r");
$email = "";
while (!feof($fd))
{
        $email .= fread($fd, 1024);
}
fclose($fd);


mail('test@test.com','From TEST','"' . $email . '"');

?>

This essentially sends me the entirety of the email.

I can't seem to find anything that doesn't rely on existing frameworks to read attachments.

Can anyone point me in the right direction for getting just the attachment data? The attachment will always be a CSV file.

4

0 回答 0