Hi

I'm evaluating the product, it is excellent.

I ask before to search only for messages with some text in the header, and works perfect. But I want only to do this for not read messages, usually are new. I found a New flag but I can not figure it how to handle this.

I'm using VB.NET and this is for IMAP (using a Gmail account)

Kindest regards

asked 22 Feb '10, 06:37

Juan%20Carlos%20Pazos's gravatar image

Juan Carlos ...
16
accept rate: 0%

edited 22 Feb '10, 14:20

Lukas%20Pokorny's gravatar image

Lukas Pokorny ♦♦
2.2k18


ImapSearchParameter.New might not be what you need - it searches for messages with the "Recent" flag - these are messages that recently arrived and your IMAP session is the first and only session notified about this. Try searching for messages without the "Seen" flag using this search parameter:

ImapSearchParameter.HasFlagsNoneOf(ImapMessageFlags.Seen)

In combination with a header search, that would be something like this:

Dim result As New ImapMessageCollection
result = client.Search( _
  ImapSearchParameter.HasFlagsNoneOf(ImapMessageFlags.Seen), _
  ImapSearchParameter.Header(headerName, queryTerm))
link

answered 22 Feb '10, 06:48

Lukas%20Pokorny's gravatar image

Lukas Pokorny ♦♦
2.2k18
accept rate: 32%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×71
×10

Asked: 22 Feb '10, 06:37

Seen: 375 times

Last updated: 22 Feb '10, 14:20