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

New Post: ImapX Latest Sample Code to Get only 1 Unread Email

$
0
0
tharush wrote:
hi All

i also use this code to get mail message. But some times it will display the correct result, But another time Imapx Exception occurs,"Bad Search Query"
The request throws bad query only if the UID is not numerical, or you're trying to request mails from an unselectable folder.



nabeel5 wrote:
Hi ,

Actually I was using client.Folders["INBOX"].Search("UNSEEN",true); to retrieve all message parts for all unread emails, but when there are large number of emails it takes lot of time which cause issues for the end users. So I used the UID in search string but it doesn't guarantee the MessageUID every time, so I have to change the code mentioned below and this resolve my issue.

What I am doing now is to retrieve all the Emails but not the complete detail for each item. and then upon specific user's email , I am processing the message to retrieve all the detail for that particular email and did my work.
Yeah, guess that's the only way at the moment, but it will change from next release.

Viewing all articles
Browse latest Browse all 1952

Trending Articles



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