2
I’m looking to refactor an email manipulation code, I know you can remove multiple messages in one operation, but and to move multiple messages to a certain folder, have as?
I use the IMAP protocol.
2
I’m looking to refactor an email manipulation code, I know you can remove multiple messages in one operation, but and to move multiple messages to a certain folder, have as?
I use the IMAP protocol.
2
Yes. I implemented a function for this, it is very easy!
public void saveMessages(Message[] mArray, String folderName) throws Exception{
//Primeiro copiamos...
Folder f = findFolder(folderName);
currentFolder.copyMessages(mArray, f);
// Depois removemos do diretório antigo!
for ( int i = 0; i < mArray.length; i++){
mArray[i].setFlag(Flags.Flag.DELETED, true);
}
currentFolder.expunge();
}
Browser other questions tagged java boar imap
You are not signed in. Login or sign up in order to post.
Man, cool, I didn’t know that you could pass several messages to a printer at once, to delete yes. Thank you
– Macario1983
could please post the code of
findFolder
.– Macario1983
Look man, I came from C++ and I don’t know much about Java no... Check there and see if there is a way to find folders and then I edit the question!
:)
– user2692