Marking mails as read in java mail

Posted on 2007-10-17
Last Modified: 2012-06-21

  How to mark the mails as read in case of java mail api's when I connect using POP3 and download the new mail arrived on the mail server.please help in this regard.
Question by:sangameshrh
    LVL 86

    Accepted Solution

    You can't 'mark as read' with POP. You can only delete or not delete them from the server
    LVL 86

    Expert Comment

    >>You can't 'mark as read' with POP.

    At least not without the use of non-standard mail headers
    LVL 92

    Assisted Solution

    you need to track that yourself on the client side
    LVL 86

    Expert Comment

    for (int msgNum = 0; msgNum < msgs.length; msgNum++)

            MimeMessage mm = (MimeMessage)msgs[msgNum];

            msgs[msgNum].setFlag(Flags.Flag.DELETED, true);

    is the sort of thing you'd do to set for deletion

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
    Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
    Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
    Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

    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

    9 Experts available now in Live!

    Get 1:1 Help Now