Hi ,
I'm trying to fetch the mail on dateTime basis from the email via ews-java api. in INboc mail exist with different different time so i want to filter out the mail which fulfill our requirement only. I am trying with the below code but it's not giving the expected result.
String str = "Jul 15 2020 13:13:38 IST"; SimpleDateFormat df = new SimpleDateFormat("MMM dd yyyy HH:mm:ss zzz"); Date date = null; try{ date = df.parse(str); } catch( ParseException e ){ e.printStackTrace( ); } SearchFilter isGreaterThan = new SearchFilter.IsLessThanOrEqualTo(ItemSchema.DateTimeReceived, date); List <EmailMessage> items1 = SearchEmail.withCriteria(isGreaterThan, 10, TimeUnit.SECONDS).answeredBy(t);
above code, in item1 it is returning all the mails i.e it is not able to filter the mail acording to SearchFilter.
If I use SearchFilter.isEqualTo() then it return o mails although there is mail exist with given date.
Can you please help me on this how to fetch the mail on given date and time via ews-java-API in JAVA.
Hi , I'm trying to fetch the mail on dateTime basis from the email via ews-java api. in INboc mail exist with different different time so i want to filter out the mail which fulfill our requirement only. I am trying with the below code but it's not giving the expected result.
String str = "Jul 15 2020 13:13:38 IST"; SimpleDateFormat df = new SimpleDateFormat("MMM dd yyyy HH:mm:ss zzz"); Date date = null; try{ date = df.parse(str); } catch( ParseException e ){ e.printStackTrace( ); } SearchFilter isGreaterThan = new SearchFilter.IsLessThanOrEqualTo(ItemSchema.DateTimeReceived, date); List <EmailMessage> items1 = SearchEmail.withCriteria(isGreaterThan, 10, TimeUnit.SECONDS).answeredBy(t);
above code, in item1 it is returning all the mails i.e it is not able to filter the mail acording to SearchFilter. If I use SearchFilter.isEqualTo() then it return o mails although there is mail exist with given date.
Can you please help me on this how to fetch the mail on given date and time via ews-java-API in JAVA.