• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 291
  • Last Modified:

PHP - Retrieve new gmail messages but keep marked as unread in gmail account

Hey everyone,
I want to create some php code that will check for and download any new messages from a gmail account. The main thing is I need the new messages to stay as unread after the php script downloads them.

Any ideas?

1 Solution
Check google mail api if it doesn't give you option to download without changing the status forward emails to another account and read from the second email account this will presserve the email read status in the original email inbox. Having said that I am sure there will be an option in google mail api which will change the status back to unread
There are quite a few articles out there on using gmail with imap in php.
The main thing you want to do is connect and create a stream
then you can use http://www.php.net/manual/en/function.imap-clearflag-full.php to clear the //seen flag.

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now