I am using below library in my composer.json file
"php-imap/php-imap": "3.0.*",
My code is below,
$folder['shortpath']="Inbox";
new \PhpImap\Mailbox('{'.$mdata["server"].":993/imap/ssl}". $folder['shortpath'], $mdata["user"], $mdata["pass"], $dir);
$mailsIds = $mailbox->searchMailbox($mailbox, 'SINCE "01 December 2018"');
echo"<pre>";print_r($mailsIds);die;
It gives me empty array instead of value of UIDs
I have total 4 emails after 1st december
If I am using below code,
$mailsIds = $mailbox->searchMailbox("ALL");
echo"<pre>";print_r($mailsIds);die;
then it gives me all emails till date in inbox
but date wise seach is not working
if I write below code then it gives error:
$mailsIds = $mailbox->searchMailbox('SINCE 01 December 2018');
ERROR:
IMAP method imap_search() failed with error: Unknown search criterion: SINCE 2018-12-06 09:32:32←
I found my solution as below , it is working for me,
I have userd
mailsIds = $mailbox->searchMailbox('SINCE "01 December 2018"');
but while open connection pass one more argument for "US-ASCII"
new \PhpImap\Mailbox('{'.$mdata["server"].":993/imap/ssl}".
$folder['shortpath'], $mdata["user"], $mdata["pass"], $dir, "US-ASCII");
But my another question is it is gives me list of new messages based on given date,
I required all update emails also like new mail, mark as unread, flagged , unflagged etc from given date. How to achive this??
Means how to identify new emails and any activity on existing emails till given date