Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How not to mark letters read? #487

Closed
StasToken opened this issue Mar 13, 2020 · 3 comments
Closed

How not to mark letters read? #487

StasToken opened this issue Mar 13, 2020 · 3 comments
Labels
question This issue is about one or more questions regarding this library.

Comments

@StasToken
Copy link

StasToken commented Mar 13, 2020

  • PHP Version: 7.4.3 (cli)
  • Type of execution: CLI

I get a list of letters like this:
$this->mailbox->searchMailbox('UNSEEN');

All letters that I receive are marked as read

I want this not to be - how to disable it? I want to mark letters after processing manually

@bapcltd-marv
Copy link
Contributor

$this->mailbox->getMail($id, false);

public function getMail($mailId, $markAsSeen = true)

@StasToken
Copy link
Author

thanks! - I somehow did not see it

@Sebbo94BY Sebbo94BY added the question This issue is about one or more questions regarding this library. label Apr 10, 2020
@vielhuber
Copy link

vielhuber commented May 31, 2021

Note that saveMail always sets mails to unread.
To overcome this the only possibility is to add markMailAsUnread directly afterwards:

before:

$mailbox->saveMail($mail_id, 'filename.eml');

after:

$unseen = in_array($mail_id, $mailbox->searchMailbox('UNSEEN', true));
$mailbox->saveMail($mail_id, 'filename.eml');
if ($unseen) { $mailbox->markMailAsUnread($mail_id); }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question This issue is about one or more questions regarding this library.
Projects
None yet
Development

No branches or pull requests

4 participants