Returns all emails on filter
nhCoder opened this issue · comments
Naveed Hassan commented
$today = new DateTimeImmutable();
$timeDel = $today->sub(new DateInterval('PT8M'));
$messages = $mailbox->getMessages(new Ddeboer\Imap\Search\Date\Before($timeDel));
I m trying to get emails received before 8 minutes ago but it returns all messages in INBOX.
Is this a bug or am I doing something wrong?
Any help will be appreciated .
Filippo Tessarotto commented
You should use the After filter
Naveed Hassan commented
do you have an example
Naveed Hassan commented
please have a look I have updated the whole question..
Naveed Hassan commented
Does it support time based search.
i looked here and they say it doesn't support time based search https://stackoverflow.com/a/26791550
Filippo Tessarotto commented
i looked here and they say it doesn't support time based search https://stackoverflow.com/a/26791550
That may be true indeed.
I would suggest you to try one or a mix of there flags:
\Ddeboer\Imap\Search\Flag\Recent
\Ddeboer\Imap\Search\Flag\Unseen
\Ddeboer\Imap\Search\State\NewMessage