We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Imap FetchMessage should not delete messages on server

I’m using the following code to get MailMessages from a Imap server.
First it gets a list of all messages, then it uses FetchMessage to get the actual MailMessage object.

Currently, the Mail is deleted on the server when FetchMessage is executed. But instead of deleting the message, i’d like to just set it to read.
Is this Possible? If yes, how can this be done?

    ImapClient imapClient = new ImapClient("outlook.office365.com", 993, Aspose.Email.Clients.SecurityOptions.SSLAuto);
    imapClient.Username = "MyUserName";
    imapClient.Password = "MyPassword";

    foreach (ImapMessageInfo imapMessageInfo in imapClient.ListMessages().Take(100))
    {
        Aspose.Email.MailMessage mailMessage = imapClient.FetchMessage(imapMessageInfo.SequenceNumber);
    }

@manuelk,

I have observed your requirements and suggest you to please visit this documentation link for setting different flags on server while fetching messages.

You’re right. This solves my issue.
Thanks

@manuelk,

It’s good to know things are fine on your end.