+1 vote

After downloading email from IMAP server using Imap.GetMessageInfoByUID(),
is it possible to get message Priority or Importance?

by

1 Answer

0 votes
 
Best answer

No it is not possible.

Those headers are not included in the server IMAP response in any way.

You can try requesting specific e-mail headers:

List<MessageData> list = client.GetSpecificHeadersByUID(
    uids, 
    new[] {"IMPORTANCE"});

IMail email = new MailBuilder().CreateFromEml(list[0].EmlData);

var importance = email.Importance;

...however it won't be as fast as GetMessageInfoByUID().

Alternatively you can search for messages with specific header value:

List<long> uids = client.Search(
    Expression.Header("Importance", "High"));
by (300k points)
...