Is there any way to download all emails that are recived between date?
i.e.:
Date from = ...
Date to = ...
Folder inbox = store.getFolder("INBOX");
inbox.open(Folder.READ_ONLY);
Message[] messages = inbox.getMessages(from, to);
Is there any way to download all emails that are recived between date?
i.e.:
Date from = ...
Date to = ...
Folder inbox = store.getFolder("INBOX");
inbox.open(Folder.READ_ONLY);
Message[] messages = inbox.getMessages(from, to);
Use Folder#search(SearchTerm). Implement a concrete subclass of SearchTerm
that overrides the SearchTerm#match(Message) method. Have it return true if the date of the Message
matches what you're interested in.
Use two ReceivedDateTerms and an AndTerm to search for messages where the date is between the two values. Once you have the Message objects, you can download or access whatever you need.