• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java mail POP mark as read and unread

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi i am developing gmail application using java mail. I can retrieve all my mail from gmail server

store.openFolder("INBOX"); and i can read messages from the folder folder.getMessages();

i can see all the messages. when i use the code

msg.getContext();
.............
...........
folder.close(false);

When i try to execute next time the same code i couldn't get back the mail which i opened already.

if i didn't open the message i can get from server ..

and if i didn't use folder.close method then all the mails i can get from the server...


Please provide me the code to read all messages from server and update opened mails like mark as read,

and when next time i should get all the mails and i should filter whether read msg or unread msg...



Thanks for any help provided
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See the last entry for JavaMail in the http://faq.javaranch.com/java/JavaEnterpriseEditionFaq.
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Loganathan Subramani wrote:Please provide me the code to read all messages from server and update opened mails like mark as read,


http://faq.javaranch.com/java/NotACodeMill
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It seems that Java Mail P0P3 API is good at reading messages, however, you could store your last read messages - mabye saving the UID & timestamp in a file or db table.

However, came across Java Mail Version 1.4.4 which has some new features available.

http://www.oracle.com/technetwork/java/javamail/index-138643.html?ssSourceSiteId=ocomen

Mabye this will help..


Chaulkie
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic