Re: Scrape? (Fetch email)
| From: | Colin Guthrie | Date: | Mon, 12 Nov 2007 21:49:16 +0000 |
| Subject: | Re: Scrape? (Fetch email) | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-264397@lists.php.net to get a copy of this message | ||
Jake wrote:
> $buffer = '';
> $fp = fopen("php://stdin", "r");
> if ($fp)
> {
> while(!feof($fp))
> {
> $buffer .= fgets($fp, 4096);
> }
> fclose($fp);
> }
>
That will get you the data (I think file_get_contents('php://stdin')
will also work).
Interpreting the mail is a little harder but I think there is a pecl
extension for it... yup: http://pecl.php.net/package/mailparse
HTHs
Col