@@ -124,6 +124,9 @@ $oClient = new Client([
124124 'username' => 'username',
125125 'password' => 'password',
126126]);
127+ /* Alternative by using the Facade
128+ $oClient = Webklex\IMAP\Facades\Client::account('default');
129+ */
127130
128131//Connect to the IMAP Server
129132$oClient->connect();
@@ -183,21 +186,33 @@ Search for specific emails:
183186
184187//Get all messages since march 15 2018
185188/** @var \Webklex\IMAP\Support\MessageCollection $aMessage */
186- $aMessage = $oFolder->query()->whereSince ('15.03.2018')->get();
189+ $aMessage = $oFolder->query()->since ('15.03.2018')->get();
187190
188191//Get all messages containing "hello world"
189192/** @var \Webklex\IMAP\Support\MessageCollection $aMessage */
190- $aMessage = $oFolder->query()->whereText ('hello world')->get();
193+ $aMessage = $oFolder->query()->text ('hello world')->get();
191194
192195//Get all unseen messages containing "hello world"
193196/** @var \Webklex\IMAP\Support\MessageCollection $aMessage */
194- $aMessage = $oFolder->query()->whereUnseen ()->whereText ('hello world')->get();
197+ $aMessage = $oFolder->query()->unseen ()->text ('hello world')->get();
195198
196199//Extended custom search query for all messages containing "hello world" and have been received since march 15 2018
197200/** @var \Webklex\IMAP\Support\MessageCollection $aMessage */
201+ $aMessage = $oFolder->query()->text('hello world')->since('15.03.2018')->get();
202+ $aMessage = $oFolder->query()->Text('hello world')->Since('15.03.2018')->get();
203+ $aMessage = $oFolder->query()->whereText('hello world')->whereSince('15.03.2018')->get();
198204$aMessage = $oFolder->query()->where([['TEXT', 'Hello world'], ['SINCE', \Carbon::parse('15.03.2018')]])->get();
199205```
200206
207+ Limiting the request emails:
208+ ``` php
209+ /** @var \Webklex\IMAP\Folder $oFolder */
210+
211+ //Get all messages for page 2 since march 15 2018 where each apge contains 10 messages
212+ /** @var \Webklex\IMAP\Support\MessageCollection $aMessage */
213+ $aMessage = $oFolder->query()->since('15.03.2018')->limit(10, 2)->get();
214+ ```
215+
201216Available search criteria:
202217- ` ALL ` &mdash ; return all messages matching the rest of the criteria
203218- ` ANSWERED ` &mdash ; match messages with the \\ ANSWERED flag set
0 commit comments