SySc0d3r
SySc0d3r

Reputation: 662

Filter by multiple subjects IMAPX

Is there any way to filter the messages' downloading by more than one specific subject?

For example, I need to download only the messages which contain "for 10" or "for 11" in their respective subjects.

With one subject it's clear:

folderSearchMessages.Messages.Download("SUBJECT for 10", messageFetchMode, numMessages)

By the way, where could I look for deeper documentation? Rather than the official page.

Upvotes: 0

Views: 962

Answers (1)

Max
Max

Reputation: 10985

Not an IMAPX user, but if it's free form text in the search string, you can just use the IMAP search language, detailed in RFC3501 §6.4.4. If your server supports search correctly (there are a lot that don't), you can use an OR term:

folderSearchMessages.Messages.Download("OR (SUBJECT \"for 10\") (SUBJECT \"for 11\")", messageFetchMode, numMessages)

Note that you should also quote your strings.

Upvotes: 1

Related Questions