Question

I'm using Imap and Chilkat on my email client. I want to set the priority of the email and apply this update to the server.

I have star icon for each email on my email list and I want to toggle priority level by clicking this star icon.

I'm getting specific email with imap.FetchSingle() and setting "X-Priority" in the header with this code:

            Email email = imap.FetchSingle(uniqueId, bIsUid);


            if (email.GetHeaderField("X-Priority") == "1 (Highest)")
            {
                //email.RemoveHeaderField("X-Priority");
                email.AddHeaderField("X-Priority", "3 (Normal)");

            }
            else
            {
                //email.RemoveHeaderField("X-Priority");
                email.AddHeaderField("X-Priority", "1 (Highest)");
            }

After updating x-priority field inside header part of the email, it doesn't update the header on the server. when I refresh the page I see the email with old priority level on the list.

So may question is how can I apply these changes to the server ?

Thanks in advance...

Was it helpful?

Solution

You can't. Messages in IMAP are immutable. You would have to upload a new copy. Normally the \Flagged flag is used instead.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top