INBOX folder
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Valentin_Pascaru
Posted On:   Tuesday, April 17, 2001 06:30 AM

Hello,
I'm pretty new with Java Mail API.I have to make a mail client let's say a much simplier Outlook Express.
What is the meaning of the INBOX folder?
Do I have to create it explicity or can I get it from somwhere.This folder resides on the mail server?
How can I get all the messages from a mail server and put them into a INBOX folder?
Best regards,
Valentin Pascaru

Re: INBOX folder

Posted By:   Christian_Varzaru  
Posted On:   Friday, May 4, 2001 07:49 AM

Nu e nevoie sa-l creezi explicit, el exista deja.. Trebuie doar sa-l declari, apoi sa-l deschizi si sa verifici daca ai mesaje in el

De ex. :
Folder folder = store.getFolder("INBOX");
// Open read-only
folder.open(Folder.READ_WRITE);

BufferedReader reader = new BufferedReader (
new InputStreamReader(System.in));

// Get directory
Message message[] = folder.getMessages();
if (message.length==0)
jLabel9.setText("No new messages ! ");
else if(message.length >0)
{ jLabel9.setText("You have new messages ");

mesaj=new String[message.length];
for (int i=0; i mesaj[i]=i+1 + " :"+ message[i].getFrom()[0]+" "+message[i].getSubject()
+" " +message[i].getSentDate();
message[i].setFlag(Flags.Flag.DELETED,true);
}
jList1.setListData(mesaj);
folder.close(true);
store.close();

Aici am folosit o lista in care sunt afisate noile mesaje cu detalii, apoi sunt sterse din server si se inchide folderul...

Good Luck
About | Sitemap | Contact