Re: Parsing single mail message from a file
| From: | Joe Stump | Date: | Thu, 30 Nov 2000 06:39:10 +0000 |
| Subject: | Re: Parsing single mail message from a file | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-27982@lists.php.net to get a copy of this message | ||
Well this is how I did it:
1.) set up qmail (whether or not this is available to you I don't know.
2.) make a .qmail-default for your address
3.) put | php -q email_header_parser.php
This is what email_header_parser.php should look like
<?
$fp = fopen('/dev/stdin','r');
while(!feof($fp))
{
$line = trim(fgets($fp,4096));
if(eregi("^From:",$line))
{
// get From: info
}
}
?>
Just repeat the eregi()'s for all the headers you want to check for...
--Joe
On Thu, Nov 30, 2000 at 05:33:06PM +1100, Mark Lipscombe wrote:
> Hi,
>
> I've searched high and low and can't find a class or function to parse mail
> headers passed to it through either a string or array variable, or from a
> file.
>
> I'm looking for something similar to Mail::Header in Perl.
>
> I can't use IMAP or POP3 to read these messages, before anyone suggests that
> :)
>
> Anyone have any ideas before I do a "roll-your-own"? :)
>
> Thanks in advance :)
>
> Mark
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
Joe Stump, PHP Hacker
joestump98@yahoo.com
http://www.miester.org/
Need a programmer? http://www.google.com/search?q=%22Joe+Stump%22
*****************************************************************
* RENT THIS SPACE - SEEN BY THOUSANDS EACH DAY! *
* Current Sponsor: http://www.sponsor.com
*
*****************************************************************