dcsimg
Remove Headers
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   John_Titeas
Posted On:   Wednesday, December 28, 2005 05:55 AM

Why i cant't remove the headers mail with this code ? // Get folder Folder folder = store.getFolder("INBOX"); folder.open(Folder.READ_WRITE); BufferedReader reader = new BufferedReader ( new InputStreamReader(System.in)); // Get directory Message message[] = folder.getMessages(); for (int i=0, n=message.length; i System.out.println("Message "+i+" :"); try{ for (Enumeration e = message[i].getAllHeaders(); e.hasMoreElements();) { Header header =(Header)e.nextElement(); message[i].removeHeader(header.getName()); System.out.println("Headers remove!"); } } catch   More>>


Why i cant't remove the headers mail with this code ?

			
// Get folder
Folder folder = store.getFolder("INBOX");
folder.open(Folder.READ_WRITE);
BufferedReader reader = new BufferedReader (
new InputStreamReader(System.in));

// Get directory
Message message[] = folder.getMessages();
for (int i=0, n=message.length; i
System.out.println("Message "+i+" :");
try{
for (Enumeration e = message[i].getAllHeaders(); e.hasMoreElements();)
{
Header header =(Header)e.nextElement();
message[i].removeHeader(header.getName());
System.out.println("Headers remove!");
}
}
catch (IllegalWriteException ie)
{
System.out.println("POP3 Messages are read-only");
}



Although i open the folder in read-write, the message is : POP3 Messages are read-only.

Can somebody help me?

   <<Less

Re: Remove Headers

Posted By:   Christopher_Koenigsberg  
Posted On:   Friday, December 30, 2005 03:02 PM

As it told you, "POP3 Messages are read-only".

Re: Remove Headers

Posted By:   WarnerJan_Veldhuis  
Posted On:   Wednesday, December 28, 2005 06:23 AM

what does the IllegalWriteException itself say? (ie.getMessage()???)
About | Sitemap | Contact