PHP Classes

How to?

Recommend this page to a friend!

      PHP MIME Email Message Parser  >  All threads  >  How to?  >  (Un) Subscribe thread alerts  
Subject:How to?
Summary:Probably I'm just stupid...
Messages:4
Author:erik bywall
Date:2008-07-16 16:06:50
Update:2008-07-16 17:21:13
 

  1. How to?   Reply   Report abuse  
Picture of erik bywall erik bywall - 2008-07-16 16:06:51
Hi,

How do I get the content of a body in a message?

Say I have an open connection to my imap-server, what function do I call and how?

Something like this??:

include("mime_parser.php");
$body = imap_body($mbox,$nr);
$parse = new mime_parser_class;
$body = $parse->Decode("Data",$body);

  2. Re: How to?   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2008-07-16 16:34:43 - In reply to message 1 from erik bywall
You need to be able to retrieve the whole message complete with headers and body so the class can parse it.

  3. Re: How to?   Reply   Report abuse  
Picture of erik bywall erik bywall - 2008-07-16 16:43:43 - In reply to message 2 from Manuel Lemos
Ok, but say I have the complete email in an array or strin or whatever....

How do I(in code) run the parsing of the mailbody?


  4. Re: How to?   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2008-07-16 17:21:13 - In reply to message 3 from erik bywall
The e-mail must be a single string with headers separated one per line followed by the body data with one line of separation from the headers. You need to pass that string as the Data entry of the $parameters argument of the Decode function. See the test_message_decoder.php example script.