-
Notifications
You must be signed in to change notification settings - Fork 459
Examples of usage
Yevgen Sh edited this page Mar 20, 2018
·
11 revisions
$mailbox = new PhpImap\Mailbox(
'{imap.gmail.com:993/ssl/novalidate-cert/imap}',
'example@gmail.com',
'password',
false // when $attachmentsDir is false we don't save attachments
);
// get the list of folders/mailboxes
$folders = $mailbox->getMailboxes('*');
// loop through mailboxs
foreach($folders as $folder) {
// switch to particular mailbox
$mailbox->switchMailbox($folder['fullpath']);
// search in particular mailbox
$mails_ids[$folder['fullpath']] = $mailbox->searchMailbox('SINCE "24 Jan 2018" BEFORE "25 Jan 2018"');
}
var_dump($mails_ids);