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

Posted on 2011-10-17
Last Modified: 2012-05-12
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?

Question by:intellect22
    LVL 11

    Expert Comment

    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
    LVL 4

    Accepted Solution

    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 to clear the //seen flag.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    This article will describe some of the best ways to process an ex-employee from an Office 365 subscription. I will describe the methods I would recommend when the data needs to be kept for the ex-employee as well as how to manage any new email as we…
    These days socially coordinated efforts have turned into a critical requirement for enterprises.
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now