+1 vote

I'm using following method to fetch header part:

List infos = imap.GetMessageInfoByUID(uids);

Then after fetching headers, I'm fetching body by following method:


But the unread mails are becoming read after fetching operation.


1 Answer

0 votes
Best answer

You can use *Peek** methods if don't want the mails to be marked as seen:

string html = imap.PeekTextByUID(info.BodyStructure.Html);
by (298k points)
selected by
Thank you that works.
But I have another issue.
For mails does not have html, Only have text data info.BodyStructure.Html is always null.

So how to fetch the body text in that case.
As you said, those mails don't have HTML body, so Html property is null. Usually they heve plain text body only. Use MessageInfo.BodyStructure.Text to get it.
OK Got it.Thank you very much or your fast reply.