This change adds all available email flags as property:
Seen (email property isSeen)
Answered (email property isAnswered)
Recent (email property isRecent)
Flagged (email property isFlagged)
Deleted (email property isDeleted)
Draft (email property isDraft)
Those can be accessed like this:
<?php
require_once __DIR__.'/../vendor/autoload.php';
use PhpImap\Exceptions\ConnectionException;
use PhpImap\Mailbox;
$mailbox = new Mailbox(
'{imap.gmail.com:993/imap/ssl}INBOX', // IMAP server and mailbox folder
'some@gmail.com', // Username for the before configured mailbox
'*********', // Password for the before configured username
__DIR__, // Directory, where attachments will be saved (optional)
'US-ASCII' // Server encoding (optional)
);
try {
$mail_ids = $mailbox->searchMailbox('ALL');
} catch (ConnectionException $ex) {
exit('IMAP connection failed: '.$ex->getErrors('first'));
} catch (Exception $ex) {
exit('An error occured: '.$ex->getMessage());
}
foreach ($mail_ids as $mail_id) {
echo "+------ P A R S I N G ------+\n";
$email = $mailbox->getMail(
$mail_id, // ID of the email, you want to get
false // Do NOT mark emails as seen (optional)
);
echo 'mail has been seen? ';
if ($email->isSeen) {
echo "Yes\n";
} else {
echo "No\n";
}
echo 'mail has been answered? ';
if ($email->isAnswered) {
echo "Yes\n";
} else {
echo "No\n";
}
echo 'mail is a draft? ';
if ($email->isDraft) {
echo "Yes\n";
} else {
echo "No\n";
}
}
$mailbox->disconnect();
This change adds all available email flags as property:
Seen
(email propertyisSeen
)Answered
(email propertyisAnswered
)Recent
(email propertyisRecent
)Flagged
(email propertyisFlagged
)Deleted
(email propertyisDeleted
)Draft
(email propertyisDraft
)Those can be accessed like this:
Solves #529.