+1 vote
by (260 points)

Hi all,

We are using Rebex.mail.dll to fetch the emails, We have to fetch the emails with specific datetime range.So We are using ImapSearchPaarmeter.Arrived(DateTime since,DateTime before) but it is only fetching the based on Date not the DateTime.

Please give me some suggestions to fetch the emails based on DateTime not Date.


Applies to: Rebex Secure Mail

1 Answer

0 votes
by (145k points)
Best answer

Unfortunately, the IMAP protocol itself only supports searching based on date. That's why the Time part of DateTime argument is ignored.

If you need to fetch emails based on DateTime instead of Date, try the following:

  1. Use ImapSearchParameter.Arrived and Imap.Search method to search based on Date.
  2. Check the date of each message in the collection returned by Imap.Search. Only fetch the messages whose date is greater than since and less than before.