|
vlad - 2009-01-22 02:27:11 - In reply to message 39 from vlad
$decoded[0]['Parts'][0]['Body']; dosent display message if it is text/plain.. however the
print_r($decoded); displays all the messages
vlad - 2009-01-22 02:32:07 - In reply to message 41 from vlad
i found why...
cos the plain message goes at the different place in array
if i use this:
$decoded[0]['Body'];
i can view other messages as well
vlad - 2009-01-26 19:37:01 - In reply to message 42 from vlad
all looks kinda fine now! i can get all i need!
i started to install all stuff at the real web-site
thanks for the class!
vlad - 2009-01-29 03:38:43 - In reply to message 43 from vlad
could you help please with some time issue?
the message date displays in array not always in the same time zone.
my email server located in NZ
for example i found some email that came to mail box by
Thu,29 Jan 2009 15:20:52 +1300 (NZDT)
however in array where i get the info it displays like below:
...
[date:] => Thu, 29 Jan 2009 05:20:26 +0300
...
how ti fix it?
Manuel Lemos - 2009-01-29 04:55:11 - In reply to message 44 from vlad
The class does not change the date header that is returned in the decoded array relatively to what comes in the message.
If you are seeing the message in your mail program with the date in your time zone, that is because your mail program is converting it.
vlad - 2009-02-11 03:03:55 - In reply to message 45 from Manuel Lemos
thanks for your patience!
i found how to sort out date!
could you help with another issue:
i use this array ($decoded) to get all info:
however, if at the email box there is some big or are several attachments it takes ages to proceed! (2-7 minutes)
is there any way to walk around it?
(i dont need to parse the attachments. i just take their names and thats it!)
below is part of your code that i use::
....
$pop3->GetConnectionName($connection_name);
$message=$i;
$message_file='pop3://'.$connection_name.'/'.$message;
$mime=new mime_parser_class;
/*
* Set to 0 for not decoding the message bodies
*/
//echo 'XXXXXXXXXXXXXXXXXXXX<hr>XXXXXXXXXXXXXXXXXXXXXX<br>';
$mime->decode_bodies = 1;
$parameters=array(
'File'=>$message_file,
/* Read a message from a string instead of a file */
//'Data'=>'My message data string',
/* Save the message body parts to a directory */
// 'SaveBody'=>'tmp',
/* Do not retrieve or save message body parts */
// 'SkipBody'=>1,
);
$success=$mime->Decode($parameters, $decoded); //// this stroke is important !!!! wihtout it nothing works
.....
Manuel Lemos - 2009-02-11 03:22:38 - In reply to message 46 from vlad
It should not take minutes, seconds maybe.
I think your problem is mostly due to keeping message data in memory. Try using SaveBody to make body parts go to disk and avoid big reallocation of big memory chunks.
You could use SkipBody but then you would not get the data of all message parts.
vlad - 2009-02-11 04:15:42 - In reply to message 47 from Manuel Lemos
yeah! that's right. it seems i use the browser memory...
my parameters are:
$parameters=array(
'File'=>$message_file,
/* Read a message from a string instead of a file */
//'Data'=>'My message data string',
/* Save the message body parts to a directory */
//'SaveBody'=>'tmp',
/* Do not retrieve or save message body parts */
// 'SkipBody'=>1,
);
and i get this data:
$email_date = $decoded[0]['Headers']['date:'];
$email_subject = mysql_real_escape_string($decoded[0]['Headers']['subject:']);
$emailFrom = $decoded[0]['ExtractedAddresses']['from:'][0][address];
$body = $decoded[0]['Parts'][0]['Body'];
i understand from your last reply that i need to use 'SaveBody'=>'tmp' parameter otherwise it will take me ages to retrieve the emails!
my question is: how do i get the info from tmp directory?
Manuel Lemos - 2009-02-11 04:49:48 - In reply to message 48 from vlad
The directory in the SaveBody parameter will only be used to save message body parts. When a new body part is saved to a file in that directory, the array returned by the Decode or Analyze functions contains the name of the files that were created with the message body part data.
vlad - 2009-02-11 21:25:33 - In reply to message 49 from Manuel Lemos
im using 'SaveBody' part see please below:
$mime->decode_bodies = 1;
$parameters=array(
'File'=>$message_file,
/* Read a message from a string instead of a file */
//'Data'=>'My message data string',
/* Save the message body parts to a directory */
'SaveBody'=>'tmp',
/* Do not retrieve or save message body parts */
'SkipBody'=>1,
);
--------------------------------------------------------------------
and here is how i get info i need from tmp dir
$fileContents = file_get_contents($decoded[0]['BodyFile']);
however the timing is the same! it takes ages to process!
what am i doing wrong now?
|