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

Free Support Forum - aspose.com

Is it possible to add custom flag to message?

I want to add custom flag to a message on my server. Is it possible to do using Aspose.Email?



You can use the API’s ImapClient for this purpose. ImapClient’s AddMessageFlags provides the capability to do so using the ImapMessageFlags. Please try the following code sample at your end and let us know if you need any further assistance in this regard.

Sample Code

// Create a message
MailMessage message = new MailMessage("user@domain1.com", "user@domain2.com", "subject", "message");

//Append the message to mailbox
string uid = client.AppendMessage(ImapFolderInfo.InBox, message);

//Add custom flags to the added messge
client.AddMessageFlags(uid, ImapMessageFlags.Keyword("custom1") | 



Is it also possible to perform the same action using the Exchange EWS client or will it be possible in the near future?

Best Regards


At present, it is not possible to achieve the same using EWS Client of the API. We’ll discuss this with our Product team for any possible methodology or implementation and will share our feedback with you here.