Free Support Forum - aspose.com

Getting Exchange ID for email

I am trying to retrieve the exchange id (not the RFC message id) for an email. There is no method for that in the ExchangeMessageInfo object so I thought it might be in the Properties. But now I’m having problems with them.

I’m attempting to print all the properties by using:

MapiPropertyCollection prop = msgInfo.getProperties();
IGenericCollection keys = prop;

Then looping through the collection. But no matter how I try, I can’t get IGenericCollection imported. The doc says it’s:

import com.aspose.ms.System.Collections.Generic.IGenericCollection;

but that gives me an error.

@dbixler,
Welcome to our community! Thank you for the query. It will take me a while to find this information. I will answer you as soon as possible.

@dbixler,

Could you provide more information about what the “exchange id” is, please?

To investigate this case on our side and help you properly, please share and specify the following:

  • email file
  • comprehensive code example reproducing the error
  • version of Aspose.Email you used

But first, please check the issue using the latest version of Aspose.Email.

The exchange id is a unique tag that specifies an email/folder combination. If two ids are the same, they are the same email in the same folder. An example:

AAMkADRlYmU1OTQ0LWI0MzktNDVkMy05NWQxLWMyYTlkYzFiYThkNQBGAAAAAABPaWE5ySmMTpl1ZGqa3XELBwDHq0enbn7ASJhyUZMq59VqAJ5CkwB0AADHq0enbn7ASJhyUZMq59VqAK3BxiAfAAA=

However, the question is about viewing properties. I simply want to examine the properties of an email. You can reproduce the error with a simple:

import com.aspose.ms.System.Collections.Generic.IGenericCollection;

According to your documents, that should be correct.

I am using aspose-email-21.3-java

@dbixler,
Please try to use the following:

import com.aspose.email.system.collections.generic.IGenericCollection;

Could share a link to this document, please?

Look at the definitions of get_Keys(), get_Values() and getKeys().

OK, the import you gave me worked and it proved that the EWS id was not in the properties. Is this something I can get from your package?

@dbixler,
Thank you for the confirmation. We are sorry for any inconvenience caused. We will fix the API Reference.

I logged the issue in our tracking system with ID EMAILJAVA-34887. Our development team will find out this possibility. I will inform you of any progress.

@dbixler,
Our development team investigated your requirement. You can get the exchange id as below:

ExchangeMessageInfo.getUniqueUri()

API Reference: ExchangeMessageInfo Class

That did the trick. I should note that I had looked at this method earlier, but did not make the connection. Perhaps the description could be enhanced?

@dbixler,
Yes, you are right. The description of this method will be improved later.