Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
Yashil
Posts: 12
Registered: ‎01-19-2013
My Device: curve 8520
Accepted Solution

how to read all emails

hi , what code do i use to read all the emails the user has recieved.

i know how to add a folder listener to read all new messages recieved but how do i read the older ones.

for example a message was recieved before the user launches the app.

thanx

Developer
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

Re: how to read all emails

Contributor
Yashil
Posts: 12
Registered: ‎01-19-2013
My Device: curve 8520

Re: how to read all emails

hi thanks for reply.

how ever that didn't work for me.

But i have found the solution

http://supportforums.blackberry.com/t5/forums/searchp age/tab/message?page=2&location=category %3Aap...

 

Store store = Session.getDefaultInstance().getStore();

Folder[] folders = store.list(Folder.INBOX);
Folder inbox = folders[0];
Message[] msgs = null;
try {
msgs = inbox.getMessages();
} catch (MessagingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}