import java.util.*; import javax.mail.*; public class FolderInfo { public static void main(String args[]) throws Exception { Properties properties = System.getProperties(); Session session = Session.getDefaultInstance(properties); Store store = session.getStore("pop3"); store.connect("192.168.10.205", "test", "test"); Folder folder = store.getFolder("inbox"); folder.open(Folder.READ_ONLY); System.out.println("Name: " + folder.getName()); System.out.println("Full Name: " + folder.getFullName()); System.out.println("URL: " + folder.getURLName()); System.out.println("Has New Messages"); System.out.println("Total Messages: " + folder.getMessageCount()); System.out.println("New Messages: " + folder.getNewMessageCount()); System.out.println("Unread Messages: " + folder.getUnreadMessageCount()); } }