Re: How to parse raw mail headers and messages?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, September 18, 2006 1:48 am, Mathijs wrote:
> Is there a way to parse mail headers from a RAW mail received from
> sendmail?

There MUST be a way, or none of us could get email... :-)

> Like extracting the from, reply-to etc.. etc.. and also the
> message(s).

You know the headers are "done" when you hit a blank line.

Finding individual headers is pretty much a case of testing for "From:
" or whatever at the beginning of a line.

> Also mabye Multipart email's en attachments?

Sure.

One of the headers will have the "separator" and then you just explode
on that.

Due to the vagaries of various MTAs, if you need a GENERAL solution
for email that anybody can just use, I'd try to go with something
pre-packaged from http://phpclasses.org or PECL or PEAR or...

If you are just trying to read your own email from a single server,
you could probably hack something just as fast as you could fight
through the docs on a pre-packaged version.

Also see http://php.net/imap of course, as noted previously.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux