55[ ![ Build Status] [ ico-travis ]] [ link-travis ]
66[ ![ Total Downloads] [ ico-downloads ]] [ link-downloads ]
77
8-
9- [ ...]
10-
118## Install
129
1310Via Composer
@@ -81,7 +78,6 @@ tested in real live but it gives an impression on how things work.
8178``` php
8279use Webklex\IMAP\Client;
8380
84- //Connect to the IMAP Server
8581$oClient = new Client([
8682 'host' => 'somehost.com',
8783 'port' => 993,
@@ -90,13 +86,15 @@ $oClient = new Client([
9086 'username' => 'username',
9187 'password' => 'password',
9288]);
89+
90+ //Connect to the IMAP Server
9391$oClient->connect();
9492
9593//Get all Mailboxes
9694$aMailboxes = $oClient->getFolders();
9795
9896//Loop through every Mailbox
99- foreach($aMailboxes as $oMailboxes ){
97+ foreach($aMailboxes as $oMailbox ){
10098
10199 //Get all Messages of the current Mailbox
102100 foreach($oMailbox->getMessages() as $oMessage){
@@ -113,6 +111,30 @@ foreach($aMailboxes as $oMailboxes){
113111}
114112```
115113
114+ If you use the Facade ('Webklex\IMAP\Facades\Client') please select an account first:
115+
116+ ``` php
117+ use Webklex\IMAP\Facades\Client;
118+
119+ $oClient = Webklex\IMAP\Facades\Client::account('default');
120+ $oClient->connect();
121+ ```
122+
123+ You can define your accounts inside the config/imap.php file:
124+ ```
125+ 'accounts' => [
126+ 'default' => [
127+ 'host' => env('IMAP_HOST', 'localhost'),
128+ 'port' => env('IMAP_PORT', 993),
129+ 'encryption' => env('IMAP_ENCRYPTION', 'ssl'),
130+ 'validate_cert' => env('IMAP_VALIDATE_CERT', true),
131+ 'username' => env('IMAP_USERNAME', '[email protected] '), 132+ 'password' => env('IMAP_PASSWORD', ''),
133+ ],
134+ 'gmail' => [.. ]
135+ ]
136+ ```
137+
116138## Change log
117139
118140Please see [ CHANGELOG] ( CHANGELOG.md ) for more information what has changed recently.
0 commit comments