在我的應用程序中,我嘗試使用java郵件API通過一個郵箱讀取收到反彈的電子郵件記錄,我相信我們可以使用javax.mail.Message嘗試獲取給定日期範圍的消息
// Get a Store object that implements the specified protocol.
store = session.getStore(protocol);
//Connect to the current host using the specified username and password.
store.connect(hostName, userName, password);
folder = store.getFolder(folderName);
Message[] messages = folder.getMessages();
但是,這將返回給我提供的文件夾中的所有消息,有沒有一種方法可以找出我在給定日期範圍內收到的消息。
在這方面的任何幫助將不勝感激。
由於
Vaibhav的
感謝這工作! – vaibhav 2012-02-29 05:34:52