Javamail: How to Search Email in Multiple Folders at Once?
I am using Javamail api. I know how to search email in one folder, but how to search email in multiple folders at once? Like issue one search command as a global search to the email account, it is for efficient purpose. The only way I can think of is to go to each folder and issue a search on each folder. But if there are 10 folders, I will have to run search function 10 times. I tried to just use the folder I got from getDefaultFolder ( ) to do the search and think that it maybe the root of all folders, but it doesn't work. I have to getFolder (each_folder) and search 10 times. Does anyone know how? I want this