0 votes

hello. how do I reduce the number of messages displayed to 1 ? so when you start IMAP client will show only one line with the text of the first new message. and another question, what should the code look like that is able to cut some of the text from a text message? for example, there is a letter with the following text "qwer123ty", how do I get the program to cut "123" from the text? I use C#, thanks for the prompt response and patience

by (1.4k points)
Please note, this is not a general C#/programming form. Your questions must relate to Mail.dll component.
I apologize, I thought the question was related to the topic.

1 Answer

+1 vote
 
Best answer

Imap.GetAll returns UIDS of all messages on the server.
You can use Imap.Search(Flag.Unseen) to download unseen UIDS only:

imap.SelectInbox();
List<long> uids = imap.Search(Flag.Unseen);

To retrieve only new messages since the last time you checked please take a look at this article:

https://www.limilabs.com/blog/get-new-emails-using-imap

Alternatively you can use search, to find specific messages:

https://www.limilabs.com/blog/how-to-search-imap-in-net

Use String.SubString to limit what you want to display.

by (301k points)
selected by
...