PHP Classes

Dealing with attachments without using SaveBody?

Recommend this page to a friend!

      PHP MIME Email Message Parser  >  All threads  >  Dealing with attachments without...  >  (Un) Subscribe thread alerts  
Subject:Dealing with attachments without...
Summary:Is it possilbe to handle attachments if I don't specify SaveBody
Messages:4
Author:Adam Pearlman
Date:2011-01-08 16:32:14
Update:2011-01-08 20:44:16
 

  1. Dealing with attachments without...   Reply   Report abuse  
Picture of Adam Pearlman Adam Pearlman - 2011-01-08 16:32:14
First of all, let me say thanks for providing this great class. I'm using it to parse emails for display on a webpage and I'm wondering if you can give me some pointers for the best approach.

Currently, I am NOT specifying the SaveBody parameter. I decode the messages, then pass each to the analyze method where they are processed and saved to a file. This works fine, except I am not sure how, or if, I can get the attachments and inline files. Is it possible with this approach?

Alternatively, I can specify a SaveBody parameter which I know will save all the parts, including the attachments to a folder. After that, I could process the emails for display.

My preference is to use the first method, but if this is not possible I understand. Can you tell me if it is possible to get and save the attachments using the first method?

  2. Re: Dealing with attachments without...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2011-01-08 17:31:29 - In reply to message 1 from Adam Pearlman
If you do not use the SaveBody parameter, message parts are returned as strings. That will work except when messages are too large, as PHP memory usage may exceed your memory limit value.

  3. Re: Dealing with attachments without...   Reply   Report abuse  
Picture of Adam Pearlman Adam Pearlman - 2011-01-08 18:11:40 - In reply to message 2 from Manuel Lemos
Ok - so then to be safe, it is best to specify the SaveBody parameter and deal with the files after?

Thanks!

  4. Re: Dealing with attachments without...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2011-01-08 20:44:17 - In reply to message 3 from Adam Pearlman
Right, provided that you have plenty of disk space in the partition that contains the path you specify in SaveBody.