dcsimg
Unable to get System flags..
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Thursday, November 7, 2002 05:08 AM

Hi I tries to check the Flags.Flag.RECENT in the message flag. Always the flag length returns 0. could u please help me. This is the first time I'm using JavaMail pkg. ..... public static void checkEmail() throws MessagingException, IOException{ Properties prop = new Properties(); prop.put("mail.pop3.host",host); Session session = Session.getInstance(prop); Store msgStore = session.getStore("pop3"); msgStore.connect(host,user,pwd); Folder inboxFolder = msgStore.getDefaultFolder().getFolder("INBOX"); inboxFolder.open(Folder.READ_ONLY); Message[] msgs = inboxFolder.getMessages(); FetchProfile profile = new FetchProf   More>>

Hi I tries to check the Flags.Flag.RECENT in the message flag. Always the flag length returns 0. could u please help me. This is the first time I'm using JavaMail pkg.



			
.....
public static void checkEmail() throws MessagingException, IOException{
Properties prop = new Properties();
prop.put("mail.pop3.host",host);
Session session = Session.getInstance(prop);
Store msgStore = session.getStore("pop3");
msgStore.connect(host,user,pwd);
Folder inboxFolder = msgStore.getDefaultFolder().getFolder("INBOX");
inboxFolder.open(Folder.READ_ONLY);

Message[] msgs = inboxFolder.getMessages();
FetchProfile profile = new FetchProfile();
profile.add(FetchProfile.Item.ENVELOPE);
profile.add(FetchProfile.Item.FLAGS);
inboxFolder.fetch(msgs,profile);

int count = inboxFolder.getMessageCount();
for (int i=0;i
//the following lines for flag checking...
Flags flags = msgs[i].getFlags();
Flags.Flag[] sysFlags = flags.getSystemFlags();
System.out.println("Flags length: "+sysFlags.length);
System.out.println("---------------------------------");
}
inboxFolder.close(false);
msgStore.close();
}
   <<Less

Re: Unable to get System flags..

Posted By:   Christopher_Koenigsberg  
Posted On:   Thursday, November 7, 2002 08:22 AM

I think (check the javadoc & FAQ) that with the JavaMail API, you can't get Flags from a Pop3 server? (I think you can only get them from an Imap server)

About | Sitemap | Contact