PHP Classes

Fantastic class, 1 question

Recommend this page to a friend!

      PHP MIME Email Message Parser  >  All threads  >  Fantastic class, 1 question  >  (Un) Subscribe thread alerts  
Subject:Fantastic class, 1 question
Summary:Determining bodies from different scenarios
Messages:8
Author:Alan Fullmer
Date:2007-09-17 08:49:40
Update:2008-01-08 05:37:13
 

  1. Fantastic class, 1 question   Reply   Report abuse  
Picture of Alan Fullmer Alan Fullmer - 2007-09-17 08:49:44
First of all, I think the class is very useful. I don't experience the same slowness that others have described. It's fast for me.

I did have a question, that I seem to be running into with a few clients. Is there something that is a sure-fire way to determine the body structure?

I notice there were a few different structures based on the type of email sent, and/or by the client that composed the email. For example,

-If it's a plain text only email,
-If it's a plain text WITH attachments,
-If it's a mixed (plain and html message), with and without attachments.

I seem to be struggling with determining how to separate the text body and html body on different types of emails. I thought I got it, then I added an attachment, and the Array seems to have appended the attachment as another value.

Has someone written a script, or is there a rule that I need to know to cover all my bases when finding the parts of the bodies? If that does not make sense, I will try to post an example.

  2. Re: Fantastic class, 1 question   Reply   Report abuse  
Picture of Alan Fullmer Alan Fullmer - 2007-09-17 09:30:33 - In reply to message 1 from Alan Fullmer
I think a few others have also asked this question on the forums, and some responses I will need to try.

But if anyone still knows of any other possibilities, I'd like to know.

Thx.

  3. Re: Fantastic class, 1 question   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2007-09-17 18:12:55 - In reply to message 1 from Alan Fullmer
Message structures are not always the same, but when I have more time I intend to add a class function to return the message structure in a more straightforward way to process.

  4. Re: Fantastic class, 1 question   Reply   Report abuse  
Picture of Alan Fullmer Alan Fullmer - 2007-09-17 18:22:09 - In reply to message 3 from Manuel Lemos
Awesome.


Hey do you take bribes... er I mean donations? :D

I'd like to donate to the cause...

  5. Re: Fantastic class, 1 question   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2007-09-18 08:11:42 - In reply to message 4 from Alan Fullmer
Actually, what I need is more time and patience. Maybe I can work it out soon.

  6. Re: Fantastic class, 1 question   Reply   Report abuse  
Picture of Alan Fullmer Alan Fullmer - 2007-09-26 02:48:25 - In reply to message 5 from Manuel Lemos
Well I understand where you are coming from.

I took a stab at it, and I just opened up a can of worms, really. There are many options as to what can happen. For example, here are some:

Text only body,
HTML only body,
Text with HTML counterpart body,
Text only with message attachment as inline or attachment
HTML only with message attachment as inline or attachment

So yeah I thought I had a script to pull all of those out, but as I ran different messages through, the mime parser script got everything perfectly, but what to do with them from that point on gave so many options, it made it a little difficult for me.

I will continue to work on something, if I get anything, I will post it for others to use.

-Alan Fullmer

  7. Re: Fantastic class, 1 question   Reply   Report abuse  
Picture of Alan Fullmer Alan Fullmer - 2007-12-15 08:26:02 - In reply to message 6 from Alan Fullmer
has anyone else created a solution for this by chance?

  8. Re: Fantastic class, 1 question   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2008-01-08 05:37:13 - In reply to message 7 from Alan Fullmer
You may try the latest version of the MIME parser class. It has a function named Analyze that can determine the type of message that it was parsed and extract only the relevant parts like the HTML part, text part, attachments, etc..