|
|
 Andrew - 2010-10-07 11:31:32 - In reply to message 10 from Manuel Lemos
You can write your example parsing the message?
$pop3->RetrieveMessage($message,$headers,$body,2);
$headm = "";
for($line=0;$line<count($headers);$line++)
$headm = $headm."".HtmlSpecialChars($headers[$line])."\n";
for($line=0;$line<count($body);$line++)
$headm = $headm."".HtmlSpecialChars($body[$line])."\n";
$headm = html_entity_decode($headm);
do parsing:
$msg_subject = '';
if ($mime->Decode(Array('Data' => $answer), $decoded)) {
if ($mime->Analyze($decoded[0], $results)) {
$msg_subject = $results['Subject'];
}
}
if ($msg_subject != "")
{
$headm = $msg_subject;
}
else
{
$headm = "No subject";
}
But the subjects, which includes Russian language not found.
Where could I make a mistake?
P.S Sorry for the trouble.
 Andrew - 2010-10-07 11:36:06 - In reply to message 11 from Andrew
Sorry,
before $msg_subject = '';
$answer = $headm;
 Manuel Lemos - 2010-10-07 11:48:26 - In reply to message 11 from Andrew
No, you need to pass the class the whole message data including the body because it expects that to parse it without errors.
You can use the POP3 class stream handler to treat messages as files and pass them to the MIME parser class. Take a look at the parse_message.php example script of the POP3 class:
phpclasses.org/browse/file/14695.ht ...
 Andrew - 2010-10-08 06:16:45 - In reply to message 13 from Manuel Lemos
Thank you
parse_message.php really helped me.
I made a mistake in specifying the function's arguments: RetrieveMessage ($ message, $ headers, $ body, 2);
What does the last argument? Number of rows from the body?
 Manuel Lemos - 2010-10-08 06:27:27 - In reply to message 14 from Andrew
Its message body lines.
 Andrew - 2010-10-08 09:35:25 - In reply to message 15 from Manuel Lemos
Many thanks,
Your classes are very helpful and easy to use.
P.S There are no buttons donate? =)
 Manuel Lemos - 2010-10-08 15:05:32 - In reply to message 16 from Andrew
Thanks, no donations are necessary, I work full time in the PHPClasses site.
You may want to become premium subscriber of the site and have other benefits:
phpclasses.org/premium/
|