|
|
 Lee Willmann - 2006-12-20 03:52:59
I've managed to get the parser working and can successfully get a var_dump of the decoded message. However, I am having problems figuring out how to reliably get to the parts of the decoded object that I need for display.
For example:
I want to show the text/plain portion of the message if there is no text/html portion. And I need to be able to access the attachments as well.
Does anyone have any advice for how to work through the object and get to the parts that I'm seeking?
The var_dump output of the sample page is kinda vague I guess.
 Manuel Lemos - 2006-12-20 19:45:49 - In reply to message 1 from Lee Willmann
The meaning of the parsed message structure is explained in the documentation of the decoded argument of the Decode function.
A message is an hierarchy of parts of different types. The part type is specified by the content-type: header.
Multipart parts may have one or more parts inside them. In that case the Parts entry is an array that describes the contained parts with a similar structure.
A message that contains alternative text and HTML parts is encapsulated in a multipart-related part.
A message with attachments is encapsulated in a multipart-mixed part.
I hope this is enough to give you an idea of how to traverse the message part structure and find what you want.
 Lee Willmann - 2006-12-21 01:01:16 - In reply to message 1 from Lee Willmann
After taking the var_dump output of a few different messages, I think I have managed to get it working, where I can display the text or HTML portion of the message as needed.
 Dominique - 2007-01-01 17:06:52 - In reply to message 3 from Lee Willmann
Hi,
I would like to use this class for parse the mails that i retrieve.
Now my main problem is to parse the correct body with all kind of mails
Is it possible that you share your work ?
Thanks
Regards
 Manuel Lemos - 2007-01-01 18:14:19 - In reply to message 4 from Dominique
The class comes with examples and documentation. Did you see that? What is your difficulty?
 Dominique - 2007-01-03 21:16:00 - In reply to message 5 from Manuel Lemos
Happy new year Manuel,
Finally I am very happy with this class !
I have a few remarks :
On some mails, i have this error :
MIME message decoding error: decoding binary encoded bodies is not yet supported at position 457
Can you tell me more about this error ? Binary can't be decoded ?
Also, on another mail i have an array in Headers->content-type:, is this an error or not ?
Regards
 Dominique - 2007-01-03 21:30:12 - In reply to message 6 from Dominique
I have also, some strange Subject like :
=?iso-8859-1?Q?Envoi_d'un_message=A0:_no=EBl_2006_=E0_fin_du_mois_=2822?= =?iso-8859-1?Q?=29.JPG?=
=?ISO-8859-1?Q?2_offres_=E0_ne_pas_manquer!?=
=?ISO-8859-1?Q?3 bonnes r=E9solutions pour 2007 !?=
...
This is the most annoying problem :(
 Manuel Lemos - 2007-01-03 21:51:15 - In reply to message 7 from Dominique
That is quoted-printable encoding. For each header encoded that way, there is an entry in the DecodedHeaders array with the decoded version of the header value.
 Manuel Lemos - 2007-01-03 21:53:50 - In reply to message 6 from Dominique
Binary isn't supposed to be used in e-mail messages.
Anyway, I can make the class handle binary bodies. Just mail me a sample message encoded that way, so I can update and test the class.
 Dominique - 2007-01-04 23:59:41 - In reply to message 9 from Manuel Lemos
Hi have send you an email tonight.
Thanks a lot.
|