Hotmail

Not able to search outlook email by SearchTerm

待回答 0 个回答

归档帖子,发布于 2013年10月29日。 产品:Hotmail(已停止开发)。 其中的信息可能已经过时。

本帖暂无中文翻译,以下为英文原文。

问题 提问于 2013年10月29日

I have written a sample code that bring email of one folder of Outlook email account between given date range. I am using Java Mail API 1.5 and Java 7.

For getting messages, I have written below code that search emails since 1-Jan-1970 to before 30-Oct-2013 -


Date FutureDate = new Date(2013 - 1900, 9, 30, 00, 00, 00);

Date PastDate = new Date(1970 - 1900, 0, 1);

SearchTerm newerThen = new ReceivedDateTerm(ComparisonTerm.LE, FutureDate);

SearchTerm olderThen = new ReceivedDateTerm(ComparisonTerm.GE, PastDate);

SearchTerm andTerm = new AndTerm(olderThen, newerThen);

Message[] msg = folder.search(andTerm);

Last week, this method is working fine for me. After that I didn't make any changes in my Mail API or other code too. but today when I try to run above code that code is returning zero length msg i.e. no message is found since 1-Jan-1970 to before 30-Oct-2013, though my folder contains 204 emails between this range.

Surprisingly, the same code working fine to search email of folders of Gmail as well as of Yahoo IMAP account.

Is there any problem with IMAP in outlook mail account.

暂无回答

撰写回答

您的邮箱地址不会被公开。请勿发布密码。

This site uses Akismet to reduce spam. Learn how your comment data is processed.