You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Real Time Monitoring](#idling-on-folders-real-time-monitoring)
26
27
27
28
## Requirements
28
29
@@ -103,7 +104,7 @@ $mailbox = new Mailbox([
103
104
104
105
#### Debugging
105
106
106
-
The `debug` configuration option controls the logging behavior during the IMAP connection process. It accepts the following values:
107
+
The `debug` configuration option controls logging behavior for the mailbox. It accepts the following values:
107
108
108
109
**Boolean:**
109
110
-`false` – (Default) Disables debugging output
@@ -375,18 +376,32 @@ This class offers a rich set of helper methods for interacting with individual e
375
376
The `Message` class provides several methods to access basic properties:
376
377
377
378
**UID and Flags**
378
-
-`uid()`: Returns the unique identifier (UID) of the message.
379
-
-`flags()`: Returns an array of flags currently set on the message.
379
+
-`$message->uid()`: Returns the unique identifier (UID) of the message.
380
+
-`$message->flags()`: Returns an array of flags currently set on the message.
380
381
381
382
**Headers and Contents**
382
-
-`headers()`: Returns the raw headers as a string.
383
-
-`contents()`: Returns the raw message content.
384
-
-`hasHeaders()` / `hasContents()`: Determine whether the message has headers or contents.
383
+
-`$message->headers()`: Returns the raw headers as a string.
384
+
-`$message->contents()`: Returns the raw message content.
385
+
-`$message->hasHeaders()` / `hasContents()`: Determine whether the message has headers or contents.
385
386
386
387
**Metadata**
387
-
-`subject()`: Returns the subject of the message.
388
-
-`date()`: Returns the message’s date as a Carbon instance (if available).
389
-
-`messageId()`: Retrieves the Message-ID header (globally unique identifier for the message).
388
+
-`$message->subject()`: Returns the subject of the message.
389
+
-`$message->date()`: Returns the message’s date as a Carbon instance (if available).
390
+
-`$message->messageId()`: Retrieves the Message-ID header (globally unique identifier for the message).
391
+
392
+
#### Additional Message Details
393
+
394
+
In addition to the methods shown above, the `Message` class provides several additional helpers:
395
+
396
+
**Flag Checking**
397
+
Quickly check whether a message has a specific flag:
398
+
399
+
-`$message->isSeen()`: Determine if the message marked as `\Seen`
400
+
-`$message->isDraft()`: Determine if the message marked as `\Draft`
401
+
-`$message->isRecent()`: Determine if the message marked as `\Recent`
402
+
-`$message->isFlagged()`: Determine if the message marked as `\Flagged`
403
+
-`$message->isDeleted()`: Determine if the message marked as `\Deleted`
404
+
-`$message->isAnswered()`: Determine if the message marked as `\Answered`
390
405
391
406
#### Address Handling
392
407
@@ -420,8 +435,8 @@ Messages that include attachments can be inspected with:
420
435
The class also provides methods to modify message flags, which help you manage the state of a message:
421
436
422
437
**Marking as Seen/Unseen**
423
-
-`markSeen($expunge = true)`: Marks the message as read.
424
-
-`unmarkSeen($expunge = true)`: Marks the message as unread.
438
+
-`markSeen()`: Marks the message as read.
439
+
-`unmarkSeen()`: Marks the message as unread.
425
440
-*Aliases:*`markRead()` and `markUnread()`.
426
441
427
442
**Other Flags**
@@ -431,15 +446,16 @@ The class also provides methods to modify message flags, which help you manage t
431
446
-`markDraft()` / `unmarkDraft()`
432
447
-`markRecent()` / `unmarkRecent()`
433
448
434
-
All these methods work by invoking the underlying IMAP `STORE` command (with the appropriate flag and operation), and optionally expunging the folder afterward.
449
+
All these methods work by invoking the underlying IMAP `STORE` command (with the appropriate flag and operation).
435
450
436
451
#### Message Manipulation
437
452
438
-
Beyond just flagging, you can move or copy messages between folders, or even delete them:
453
+
Beyond just flagging, you can move or copy messages between folders, as well as delete them:
439
454
440
-
-`copy(string $folder, bool $expunge = true)`: Copies the message to the specified folder.
441
-
-`move(string $folder, bool $expunge = true)`: Moves the message to the specified folder.
442
-
-`delete(bool $expunge = true)`: Marks the message as deleted and, if desired, expunges it from the folder.
455
+
-`copy(string $folder)`: Copies the message to the specified folder.
456
+
-`move(string $folder, bool $expunge = false)`: Moves the message to the specified folder.
457
+
-`restore()`: Restores the message from the trash.
458
+
-`delete(bool $expunge = false)`: Marks the message as deleted and, if desired, expunges it from the folder.
443
459
444
460
#### Example: Interacting with a Retrieved Message
445
461
@@ -487,6 +503,40 @@ $message->move('Archive');
487
503
$message->delete();
488
504
```
489
505
506
+
### Creating Draft Messages
507
+
508
+
ImapEngine allows you to create draft messages and save them to the server for later editing or sending.
509
+
510
+
To create a new draft message, you may use the `append()` method on a folder instance:
0 commit comments