2

Currently I'm using https://github.com/Eden-PHP/Mail (A PHP library to fetch inbox).

As per documentation, I'm not able to fetch unread emails.

My requirement is to fetch unread emails, after processing I want to update it as read!.

  • From their docs, i can see that it has a search function: $emails = $imap->search(array('UNSEEN')); https://github.com/Eden-PHP/Mail#searching – Mojo Allmighty Apr 19 '17 at 11:32
  • They didn't mention where to call the function `$imap->search(array('UNSEEN')); ` –  Apr 19 '17 at 11:38
  • I don't understand your last comment... – Mojo Allmighty Apr 19 '17 at 11:42
  • Updated, please have a look –  Apr 19 '17 at 11:43
  • You need to connect first: `$imap = new Imap($host,$user,$pass,$port = null, $ssl = false, $tls = false);` then call the `search()` function – Mojo Allmighty Apr 19 '17 at 11:49
  • Thanx! Search I'm able to use now! Now, how to set the email as read? –  Apr 19 '17 at 12:37
  • You should probably read RFC3501 so you understand how IMAP works, then you'll know how to use the library. Presumably you want to use a function named `store` or similar, to change the flags. – Max Apr 19 '17 at 13:30

0 Answers0