Skip to content

Commit

Permalink
Update FAQ.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jstedfast committed Nov 6, 2014
1 parent 1c8ee3e commit ce06fc6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,21 @@ GMail account via your web browser and navigate to the `Forwarding and POP/IMAP`
GMail Settings page and set your options to look like this:

![GMail POP3 and IMAP Settings](http://content.screencast.com/users/jeff.xamarin/folders/Jing/media/7d50dada-6cb0-4ab1-b117-8600fb5e07d4/00000022.png "GMail POP3 and IMAP Settings")

### How can I search for messages delivered between two dates?

The obvious solution is:

```csharp
var query = SearchQuery.DeliveredAfter (dateRange.BeginDate).And (SearchQuery.DeliveredBefore (dateRange.EndDate));
var results = folder.Search (query);
```

However, it has been reported to me that this doesn't work reliably depending on the IMAP server implementation.

If you find that this query doesn't get the expected results for your IMAP server, here's another solution that should always work:

```csharp
var query = SearchQuery.Not (SearchQuery.DeliveredBefore (dateRange.BeginDate).Or (SearchQuery.DeliveredAfter (dateRange.EndDate)));
var results = folder.Search (query);
```

0 comments on commit ce06fc6

Please sign in to comment.