PHP Classes

Get text parts only?

Recommend this page to a friend!

      PHP MIME Email Message Parser  >  All threads  >  Get text parts only?  >  (Un) Subscribe thread alerts  
Subject:Get text parts only?
Summary:Would be very useful to get "main" body part without attachments
Messages:4
Author:Roger Lainson
Date:2009-05-18 08:06:10
Update:2009-07-24 20:52:47
 

  1. Get text parts only?   Reply   Report abuse  
Picture of Roger Lainson Roger Lainson - 2009-05-18 08:06:10
Great class - going to be very useful, so thanks for your work.

Because of a tendency (at least around here) to have huge (pdf) attachments, it would be very useful to be able to get out the "main" message body as a string, without decoding the attachments. In other words, to have a parameter meaning "SkipBodyExceptForTextPlainOrTextHtml"! Any possibility?

  2. Re: Get text parts only?   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2009-05-21 08:48:03 - In reply to message 1 from Roger Lainson
Good idea. I will add it to me to do list. I just cannot promise when I be able will do it. Hang on.

Meanwhile, if you tell the class to save messages parts to disk, it will save you a lot of memory during parsing.

  3. Re: Get text parts only?   Reply   Report abuse  
Picture of Roger Lainson Roger Lainson - 2009-05-21 23:19:32 - In reply to message 2 from Manuel Lemos
Thanks Manuel - when you can, I'm not in a great hurry. Now I think about it, maybe the easiest way would be optionally pass in an array of part numbers for which you want the Body parts. It would then be possible to first decode the message skipping all the parts, then check the type (and size!) of the parts, and then decode again to get the wanted one(s).

Cheers, Roger

  4. Re: Get text parts only?   Reply   Report abuse  
Picture of michael sullivan michael sullivan - 2009-07-24 20:52:47 - In reply to message 3 from Roger Lainson
yes, just realizing that this enhancement would be important for me as well.