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
Hi Nabeel,

at the moment it's a little complicated to get only one message. What you can do, is limiting your request to retrieve only the messages which have the Recent flag set:
var messages = myFolder.Search("RECENT");
another options is to use the NEW query, which will retrieve all recent messages, which are not marked as seen:
var messages = myFolder.Search("NEW");
This will allow you to request a minimum of messages. After you received the messages, you can use the AddFlag method on a message to mark it as read, so it won't be included in the next request.

Best regards,

Pavel Azanov

Viewing all articles
Browse latest Browse all 1952

Trending Articles



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