PHP Classes

How to format body

Recommend this page to a friend!

      POP3 e-mail client  >  All threads  >  How to format body  >  (Un) Subscribe thread alerts  
Subject:How to format body
Summary:How to save body parts of a message
Date:2013-02-26 19:29:17
Update:2013-02-27 05:46:44

  1. How to format body   Reply   Report abuse  
davide - 2013-02-26 19:29:17
Hi Manuel,
First of all, Thank you for this great PHP class.
I used your class for retrieve email from different pop3 address of different users in my site.

When i get all the email messages i use:
$parameters=array( 'File'=>$message_file, 'SaveBody'=>'../../'.$this->username.'/tmp_allegati_mail', );
$success=$mime->Decode($parameters, $decoded); $mime->Analyze($decoded[0], $results);
$allegati[$j]["filename"] = $this->correggi($results["Attachments"][$j]["FileName"]);

Everithing works great,
I can now save all the information of an email: Subject, Addressto,Addressfrom...and all the attchaments in different file.

The only problem is: how can i format the "1" file (the body of the email)?
because if i save it as .txt i loose all the styles and if i format it as .html i loose all the break-line, all the indentation...

Thank you sir!

  2. Re: How to format body   Reply   Report abuse  
Manuel Lemos - 2013-02-27 05:46:44 - In reply to message 1 from davide
Each message may be text, HTML or something else. You need to figure what it is to display it. Use the Analyze function to help you figure the main message type and the data that you need to use to render it.