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

Free Support Forum - aspose.com

MapiMessage.FromStream is missing most embedded attachment properties

I am trying to load a MSG that has an embedded bmp attachment. When I look at the properties MapiMessage.FromStream produces, all but Content are null. Is there a work around to get information like mime-type or file extension?

Here is an example of what I am talking about.
Task Request Meeting With Embedded BMP.zip (1.5 MB)

@aaron.medina,

We have analyzed your sample file with the latest version (17.10) of the API and found abnormality where attachment to this main message is read as another message instead of bitmap. Can you please share which version of the API you are using at your end? This will help us analyze the issue further in detail for reporting accordingly.

@kashif.iqbal
Thank you for the quick response. I am using version 17.1.0.

@aaron.medina,

The properties are not present in the attachment MSG file as can be seen from Outlook Spy here. That is the reason the API is not able to find this information from the file.

@kashif.iqbal
I agree but will this be handled by Aspose in a future release?

Also, MailMessage.Load can handle this case. Is there a reason for that? Could the mime information be hidden somewhere in the MapiMessage that I am not seeing?

I’d use MailMessage.Load instead but then other issues are presented so I can’t use it reliably in this situation.

@aaron.medina,

We are looking into this issue and will soon share our feedback with you here.

@aaron.medina,

We have looked into it and it seems the API behaviour is as expected in this case. When the same message is opened in Outlook Spy, these properties are not present. Due to this, the information is also not available to the API. Could you please share with us what sort of issues you are facing with MailMessage?

@kashif.iqbal

The issues are when there is also a journal attachment. If MailMessage is used to load a Journal Attachment, the date property is incorrect. In the past I asked how to load a journal attachment and it was recommended to use MapiMessage. So I need to use MapiMessage in the case of Journal Attachments but then the information about the bmp is lost. Thank you for your help.

@aaron.medina,

Could you please try using MapiMessage with another sample file that has the properties available? It should work if the sample message has these properties available. For MailMessage, please share a sample message with us for investigate at our end.

Unfortunately, I don’t have the choice of controlling what attachments I receive from our users. This is a valid case we have seen that is reproducible in Outlook. We would also hope that if MailMessage can provide the mimetype that MapiMessage would be able to as well. Here is an example of why we can’t use MailMessage to load MSGs reliably. Notice how the date is always set to the time it was loaded for the Journal attachment when MailMessage is used.

DIBandJournal.zip (850.2 KB)

@aaron.medina,

MailMessage.Date shows the same time as is displayed by MS Outlook in this case. Could you please confirm to us if you are using the latest version of the API at your end? If possible, please illustrate the issue with the help of an image highlighting the problematic area.

With the msg I sent you there is a journal attachment inside. If you were to load it using MailMessage, it would load with a time of “Now” every time. Another attachment is the bmp which will load perfectly in a MailMessage but will not load properly in MapiMessage. I have put together two tests to illustrate my point. These tests should pass if the information is loaded as I would it expect it to. However, these tests will not pass due to the problems I just explained.

LoadMsgTests.zip (940 Bytes)

@aaron.medina,

We are investigating the issue further for the problems you have mentioned and will update you here soon with our findings.