Updating the message category in Outlook

@skarlsen

I have observed the issue shared by you and we need to investigate this further on our end. A ticket with ID EMAILNET-40147 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be addressed.

Hello,

Any progress for the issue we addressed while Updating the category in Outlook using the Aspose.Email.Clients.Graph class.

Thank you.

@skarlsen

I regret to share that at present the issue is still unresolved. We request for your patience and likely the issue gets fixed in upcoming version of Aspose.Email for .NET. We will share notification with you once it will be fixed.

The issues you have found earlier (filed as EMAILNET-40147) have been fixed in this update.

Hello,

I have checked with the updated version of the Aspose Email Package i.e 21.3.0 and still getting the ItemId as null.ItemId.PNG (8.0 KB)
And we are using the code EmailParser.zip (475.6 KB)

Can you please guide us how can we get the ItemId from the outlook message file?

Thank you

@skarlsen,
The ItemId property is filled by the server and is required for further message processing. You can receive and process the message as shown below:

FolderInfoCollection folderInfoCol1 = graphClient.ListFolders();
FolderInfo inbox = null;
foreach (FolderInfo folderInfo in folderInfoCol1)
{
    if (folderInfo.DisplayName.Equals("Inbox", StringComparison.InvariantCultureIgnoreCase))
    {
        inbox = folderInfo;
        break;
    }
}

MessageInfoCollection messageInfoCol = graphClient.ListMessages(inbox.ItemId);

for (int i = messageInfoCol.Count - 1; i >= 0; i--)
{
    MapiMessage message = graphClient.FetchMessage(messageInfoCol[i].ItemId);
    message.Subject = "new subject";
    message.Body = "new body";
    MapiMessage updmsg = graphClient.UpdateMessage(message);
}

More examples: How to use GraphClient for Microsoft Graph

@Andrey_Potapov
From the above code we understood that , you are retrieving all the messages from the inbox folder from outlook and updating the subject/category.
But in our case we already have a message file for which we want to update the category and for that ItemId is required which is getting as null.
Is there any possibility of updating the existing message file?

Thank you

@skarlsen,
Unfortunately, in this case, there is no way to update the message category, because there is no relation with a message on the server. You should use our GraphClient to receive the messages. Then you could use the filled ItemId to update the message category for the server.

@Andrey_Potapov

The thing which you are suggesting is not what we are looking for, We are creating a outlook email file in the memory using your Email Library in which we want to update the category
Is there any alternative to implement this?

Thank you

@skarlsen

We are sorry for your inconvenience. Can you please share the details of the issue/requirement that what you want API to offer to you. Perhaps a snapshot will be helpful and I will verify that to assist you further.

@mudassir.fayyaz

What we want is to read the message from email file which we are creating using your library and update the outlook category in it,instead of reading all the messages from the inbox folder of outlook server,Here is the sample code which we are using in which ItemId is getting null which is required to update the category in outlook email. EmailParser.zip (475.6 KB)
ItemId.PNG (8.0 KB)

@skarlsen

We need to further investigate this on our end and a ticket with ID EMAILNET-40312 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.

@skarlsen,

Could you please share a code example demonstrating how you do this?

Here is the sample web api in which we are creating a message file from input stream using MapiClass and trying to update the category in that email file but not able to do that becaue ItemId is coming null.
CreateMessage.JPG (14.0 KB)
TestWebAPI.zip (30.5 KB)

@skarlsen,
Thank you for the additional information. I will answer you as soon as possible.

@skarlsen,
Far as I can see, you do not receive the messages through Aspose.Email API:

var document = HttpContext.Current.Request.Files["document"]; // <---
// ...
var message = MapiMessage.FromStream(document.InputStream);

Therefore, the ItemId property is null. You should use the method described above to receive the messages through Aspose.Email API and to achieve your goal. If the message has already been received through another way and the ItemId property is null, it will not be possible to update the category.

In the above code of our Web API which accepts an email as HttpPostedFile and converts it into MapiMessage object and then we want to update category in outlook for that email.
So is there any way to achieve this requirement?

@skarlsen,
Unfortunately, as explained above, this is not possible in your case.

Is there any possibility to arrange call with your support team tomorrow to discuss our requirement clearly?

@skarlsen,
Unfortunately, we do not practice support through calls. You can describe your requirements in more detail here.