Jump to content

limit # of messages returned


jakebur01

Recommended Posts

How can I limit the number of messages returned to 25 and sort them by date?

 

$result = imap_search($mbox,"FROM $customer_email");


echo"<table width=100% border=1>";

foreach ($result as $value)
{

$mailHeader = @imap_headerinfo($mbox, $value); 

$from = $mailHeader->fromaddress; 

$subject = strip_tags($mailHeader->subject); 

$date = $mailHeader->date;

echo "<tr><td>$from</td><td><a href=\"imap_email.php?what=read&eid=$value\" target=\"_blank\">$subject</a></td><td>$date</td><tr>"; 


}

echo"</table>";
imap_close($mbox);

 

Link to comment
Share on other sites

I don't know how to limit them, but what I do know is you can use the following to filter the results:

 

ALL - return all messages matching the rest of the criteria

ANSWERED - match messages with the \ANSWERED flag set

BCC "string" - match messages with "string" in the Bcc: field

BEFORE "date" - match messages with Date: before "date"

BODY "string" - match messages with "string" in the body of the message

CC "string" - match messages with "string" in the Cc: field

DELETED - match deleted messages

FLAGGED - match messages with the \FLAGGED (sometimes referred to as Important or Urgent) flag set

FROM "string" - match messages with "string" in the From: field

KEYWORD "string" - match messages with "string" as a keyword

NEW - match new messages

OLD - match old messages

ON "date" - match messages with Date: matching "date"

RECENT - match messages with the \RECENT flag set

SEEN - match messages that have been read (the \SEEN flag is set)

SINCE "date" - match messages with Date: after "date"

SUBJECT "string" - match messages with "string" in the Subject:

TEXT "string" - match messages with text "string"

TO "string" - match messages with "string" in the To : UNANSWERED - match messages that have not been answered

UNDELETED - match messages that are not deleted

UNFLAGGED - match messages that are not flagged

UNKEYWORD "string" - match messages that do not have the keyword "string"

UNSEEN - match messages which have not been read yet

 

You could use SINCE and limit them that way...

 

Maybe there is some hack available to do what you want it to do?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.