在我的应用程序中,我尝试使用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