- $j = 0;
- for ($q = $real_startMessage; $q >= $real_endMessage; $q--) {
- if($mailbox == $sent_folder)
- $hdr = sqimap_get_small_header ($imapConnection, $q, true);
- else
- $hdr = sqimap_get_small_header ($imapConnection, $q, false);
-
- $from[$j] = $hdr->from;
- $date[$j] = $hdr->date;
- $subject[$j] = $hdr->subject;
- $to[$j] = $hdr->to;
- $priority[$j] = $hdr->priority;
- $cc[$j] = $hdr->cc;
- $size[$j] = $hdr->size;
- $type[$j] = $hdr->type0;
- $flags[$j] = sqimap_get_flags ($imapConnection, $q);
- $id[$j] = $q;
- $j++;
- }
+ $msgs_list = sqimap_get_small_header_list($imapConnection, $id, $issent);
+ $flags = sqimap_get_flags_list($imapConnection, $id, $issent);
+ foreach ($msgs_list as $hdr) {
+ $from[] = $hdr->from;
+ $date[] = $hdr->date;
+ $subject[] = $hdr->subject;
+ $to[] = $hdr->to;
+ $priority[] = $hdr->priority;
+ $cc[] = $hdr->cc;
+ $size[] = $hdr->size;
+ $type[] = $hdr->type0;