Re: Parsing a stdClass Object created with mimeDecode
| From: | Richard Lynch | Date: | Tue, 16 May 2006 01:33:47 +0000 |
| Subject: | Re: Parsing a stdClass Object created with mimeDecode | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-236257@lists.php.net to get a copy of this message | ||
On Fri, May 12, 2006 6:12 am, Jochem Maas wrote:
> Graham Anderson wrote:
>> I am trying to get the body text from a number of different emails
>> using mimeDecode [Pear]
>> Unfortunately, it appears that the body text could be in any number
>> of
>> locations in the stdClass Object depending on which email is
>> processed.
>> At this point, I can only access the node by looking at the print_r
>> ($structure) directly :(
As I recall, finding the plain-text body was a royal pain in the ass...
I think you end up having to write a recursive function searching
through all the headers and crap until you find a mime type plain/text
I believe I ended up just "giving up" and assuming that any email with
a "too complex" HTML body part struture *MUST* be spam, and I just
threw it away. But I was writing a custom spam filter at the time, so
that may have influenced my decision. :-)
--
Like Music?
http://l-i-e.com/artists.htm