Quantcast
Channel: ImapX 2
Viewing all articles
Browse latest Browse all 1952

New Post: Question about Search Queries

$
0
0
Hi,
I've just seen this project and it seems to be great.
But I've runned into a problem when trying to perform SearchMessage.
I want to search by sender and date.
So I call SearchMessage in the following way
String dts = DateTime.Now.Subtract(new TimeSpan(6, 0, 0)).ToString("d-MMM-yyyy", CultureInfo.InvariantCulture);
String searchQuery = String.Format("FROM \"{0}\" SINCE {1}", senderToSearch, dts);
MessageCollection msgcoll = imap.SearchMessage(searchQuery);
The resulting search query is
"UID SEARCH FROM \"sag@ich.net\" SINCE 6-May-2013\r\n"

But this alway results in an exception "Bad Search Command".
But this search command should work becaus in my rather crude own attempts to access IMAP I've already tested it and it delivered results.

There I build the command this way:
String.Format("$ SEARCH FROM \"{0}\" SINCE {1}", sender,dts)
Any Idea what I've done wrong when trying it with ImapX?

Thanks

Markus

Viewing all articles
Browse latest Browse all 1952

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>