dcsimg
how to move message from one folder to another ?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   chirag_patel
Posted On:   Wednesday, October 9, 2002 08:04 AM

Please help me. My problem is how to move a message from one folder to another folder ? I tried to use copyMessages method, but i couldn't succeed.



Please help me.


Thank you.


Chirag

Re: how to move message from one folder to another ?

Posted By:   Asif_Sajjad  
Posted On:   Wednesday, October 9, 2002 11:17 AM

Here is the code I am using to move the messages to another folder.
In findFolder method I search for the folder name and then open the folder to read write. CurrentFolder is the folder from where the messages are copied to the destination folder.


public void saveMessages(Message[] mArray, String folderName) throws Exception{
Folder f = findFolder(folderName);
currentFolder.copyMessages(mArray, f);

// Now the delete the messages from Current Folder
for ( int i = 0; i < mArray.length; i++){
mArray[i].setFlag(Flags.Flag.DELETED, true);
}
currentFolder.expunge();
}


Hope this helps
About | Sitemap | Contact