SSilence / php-imap-client

a easy solution for simple IMAP email access in php
MIT License
268 stars 136 forks source link

whats the diffrence between getMessageOverview() and getMessagesOverview()? #166

Closed abdullahseba closed 7 years ago

abdullahseba commented 7 years ago

Hi whats the difference between getMessageOverview() and getMessagesOverview()

one returns:

stdClass Object ( [subject] => Re: test [from] => Walthamstow Pumphouse museum [to] => Abdullah Seba [date] => Sun, 16 Apr 2017 06:32:23 +0000 [message_id] => [references] => [in_reply_to] => [size] => 5152 [uid] => 1 [msgno] => 1 [recent] => 0 [flagged] => 0 [answered] => 0 [deleted] => 0 [seen] => 1 [draft] => 0 [udate] => 1492324343 )

the other:

Array ( [0] => stdClass Object ( [subject] => Re: test [from] => Walthamstow Pumphouse museum [to] => Abdullah Seba [date] => Sun, 16 Apr 2017 06:32:23 +0000 [message_id] => [references] => [in_reply_to] => [size] => 5152 [uid] => 1 [msgno] => 1 [recent] => 0 [flagged] => 0 [answered] => 0 [deleted] => 0 [seen] => 1 [draft] => 0 [udate] => 1492324343 ) )

why do both require an id? if it had sort option and got the all the messages in the folder like getMessages() it would be perfect cuz its much faster than getMessages() Thanks

mattparksjr commented 7 years ago

I did not originally write those methods. @sergey144010 can you please explain?

sergey144010 commented 7 years ago

The first returns one object, and the second array of objects. To return an array of objects, a range of values is required, for example 1:5. Therefore, in the first case, only one id is needed, for example 3, and in the second one, for example, 1:3. More details can be found here http://php.net/manual/en/function.imap-fetch-overview.php

sequence A message sequence description. You can enumerate desired messages with the X,Y syntax, or retrieve all messages within an interval with the X:Y syntax

abdullahseba commented 7 years ago

Makes sense. I'll close the issue.