@@ -46,6 +46,8 @@ ImapEngine provides a simple, fluent API for working with IMAP mailboxes, messag
46
46
To connect to a mailbox, create a new ` Mailbox ` instance with the configuration options:
47
47
48
48
``` php
49
+ use DirectoryTree\ImapEngine\Mailbox;
50
+
49
51
$mailbox = new Mailbox([
50
52
'port' => 993,
51
53
'username' => '...',
@@ -58,6 +60,8 @@ $mailbox = new Mailbox([
58
60
To connect using an OAuth token, pass the token as the password, and set the ` authentication ` method to ` oauth ` :
59
61
60
62
``` php
63
+ use DirectoryTree\ImapEngine\Mailbox;
64
+
61
65
$token = '...';
62
66
63
67
$mailbox = new Mailbox([
@@ -73,6 +77,8 @@ $mailbox = new Mailbox([
73
77
To connect using plain (without encryption) or starttls, set the ` encryption ` option to ` starttls ` :
74
78
75
79
``` php
80
+ use DirectoryTree\ImapEngine\Mailbox;
81
+
76
82
$mailbox = new Mailbox([
77
83
'port' => 143,
78
84
'encryption' => 'starttls',
@@ -85,6 +91,8 @@ $mailbox = new Mailbox([
85
91
There are also many other configuration options available you may find useful:
86
92
87
93
``` php
94
+ use DirectoryTree\ImapEngine\Mailbox;
95
+
88
96
$mailbox = new Mailbox([
89
97
'port' => 993,
90
98
'host' => '',
@@ -115,6 +123,8 @@ It accepts the following values:
115
123
- ` true ` – Enables debugging using an ` EchoLogger ` , which outputs debug messages to the console
116
124
117
125
``` php
126
+ use DirectoryTree\ImapEngine\Mailbox;
127
+
118
128
// No debug output.
119
129
$mailbox = new Mailbox([
120
130
// ...
@@ -132,6 +142,8 @@ $mailbox = new Mailbox([
132
142
When set to a file path (e.g., ` '/path/to/log/file.log' ` ), a ` FileLogger ` is instantiated to write debug messages to the specified file.
133
143
134
144
``` php
145
+ use DirectoryTree\ImapEngine\Mailbox;
146
+
135
147
// Output debug messages to a file.
136
148
$mailbox = new Mailbox([
137
149
// ...
@@ -145,6 +157,8 @@ If provided with a fully-qualified class name (and the class exists), an instanc
145
157
The class must implement ` DirectoryTree\ImapEngine\Connection\Loggers\LoggerInterface ` .
146
158
147
159
``` php
160
+ namespace App\Loggers;
161
+
148
162
use DirectoryTree\ImapEngine\Connection\Loggers\LoggerInterface;
149
163
150
164
class CustomLogger implements LoggerInterface
@@ -168,6 +182,9 @@ class CustomLogger implements LoggerInterface
168
182
```
169
183
170
184
``` php
185
+ use App\Loggers\CustomLogger;
186
+ use DirectoryTree\ImapEngine\Mailbox;
187
+
171
188
$mailbox = new Mailbox([
172
189
// ...
173
190
'debug' => CustomLogger::class,
@@ -177,6 +194,7 @@ $mailbox = new Mailbox([
177
194
Or, if you use [ Spatie Ray] ( https://spatie.be/products/ray ) , you may use the built in ` RayLogger ` :
178
195
179
196
``` php
197
+ use DirectoryTree\ImapEngine\Mailbox;
180
198
use DirectoryTree\ImapEngine\Connection\Loggers\RayLogger;
181
199
182
200
$mailbox = new Mailbox([
0 commit comments