|The doc says: <pre>/* OpenMessage method - the $message argument indicates the number of|
a message to be opened. The $lines argument tells how many lines of
the message are to be retrieved. Pass a negative number if you want
to retrieve the whole message. */</pre>
but it appears that OpenMessage does not actually return anything but an error, if there is one. Is that correct ?
If not, how is the message returned ?
|2007-06-01 12:47:44 - In reply to message 1 from william drescher|
|Further: What I want to do is retrieve a message using pop3_class and then pass it to mime_parser_class for decoding. get_message appears to not be the correct way of getting the message as it splits the headers from the body and it seems that mime_parser wants the raw message.|
Perhaps you would be so kind as to post a very simple script that shows the integration of pop_message_class and mime_parser_class to get one message and decode it ?
Thanks for writing the classes and for the continuing support.
|2007-06-01 18:28:16 - In reply to message 1 from william drescher|
|OpenMessage does not retrieve the messages. It just tells the class to start reading the data of a message. You need to use GetMessage to retrieve the message data itself in chunks.|
|2007-06-01 18:34:42 - In reply to message 3 from Manuel Lemos|
|What is the need for the $lines parameter in OpenMessage as it does not download message lines ?|
|2007-06-01 18:37:15 - In reply to message 2 from william drescher|
|You need to use OpenMessage followed by GetMessage to retrieve the whole message data.|
You can also use the POP3 class stream handler to tell PHP to treat messages in the mailbox as if it were regular disk files. Take a look at the parse_message.php for an example.
|2007-06-01 19:11:15 - In reply to message 5 from Manuel Lemos|
|I got it !|
The $lines parameter in OpenMessage says how large the chunks will be when one calls GetMessage.
Question: IN using the streams handler in POP3_class:
$message_file='pop3://'.$user.':'.$password.'@localhost/'.$message. '?debug='.$debug.'&html_debug='.$html_debug.'&realm='.$realm.'&workstation='.$workstation. '&apop='.$apop.'&authentication_mechanism='.$authentication_mechanism;
if the ISPs mail server is 'pop.mailserver.com', and
my account is 'email@example.com', and
my password is 'password',
what would the form of the request be ?
|2007-06-01 19:35:31 - In reply to message 5 from Manuel Lemos|
|I am still confused:|
OpenMessage has a $lines parameter, which can be set to -1 to indicate all lines.
Get Message has a $count parameter that must be set to a number of characters.
I presume from testing that this is a max number and need not be an exact number. Correct ?
I still don't see the utility of the $lines parameter.
|2007-06-01 21:28:20 - In reply to message 6 from william drescher|
|$user = UrlEncode('firstname.lastname@example.org');|
$password = UrlEncode('password');
$message = 1;
$debug = 1;
$html_debug = 1;
|2007-06-01 21:33:07 - In reply to message 7 from william drescher|
|The $lines parameter should be set to -1 unless you only want to receive the first few lines that you specify.|
The $count parameter defines the limit size of the chunks of the message that you will retrieve on each call to the GetMessage function. Set it to no more than a few tens of K so you do not exceed the memory limits set in PHP configuration when you are retrieving large messages.
||10. Re: OpenMessage
|2007-06-02 18:05:13 - In reply to message 9 from Manuel Lemos|
|THank you for all the help.|
Got it working now.