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?

intellect22Asked:
Who is Participating?
 
owner66Connect With a Mentor Commented:
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.
0
 
mattibuttCommented:
Hi
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
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.