Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How to sort the messages in JavaMail?

javamail Messages sort
0
Posted

How to sort the messages in JavaMail?

0

Location: http://www.jguru.com/faq/view.jsp?EID=266225 Created: Nov 30, 2000 Modified: 2000-11-30 09:31:57.594 Author: John Zukowski (http://www.jguru.com/guru/viewbio.jsp?EID=7) Question originally posed by guan ho (http://www.jguru.com/guru/viewbio.jsp?EID=126860 Within the JavaMail classes there is no support for this. However, once you get the array of messages back from a folder, you can call the Arrays.sort() method in the collections framework to sort the messges. Since MimeMessage doesn’t implement Comparable, you’ll need to provide your own Comparator specifying how you want the messages to be sorted.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123