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

Free Support Forum - aspose.com

Attachmenmt not recognized

The attachement is not recognized in aspose.email (nor in the aspose.network). It thinks there are no attachements...

Please advice!

Sander van Haaff

Hi I have tested the message and indeed attachements collection has count =0

This is my test code.

MailMessage message = MailMessage.Load(@“c:\test.msg”, MessageFormat.Msg);
foreach (Attachment a in message.Attachments)

I use latest aspose.email.dll version 1.1 for framework 3.5 (productversion 2011.10.28)

Sander van Haaff

Hi Sander van Haaff,

I am sorry for delayed response.

I can reproduce your said issue with your provided sample file and your provided source code. Also this issue is reproduce-able through below code snippet.


var message = Aspose.Email.Outlook.MapiMessage.FromFile(“C:\temp\test.msg”);

var attachments = message.Attachments;

for (int i = 0; i < attachments.Count; i++)


attachments[i].Save(“C:\temp\” + attachments[i].DisplayName);


We are looking into this matter further. Can you please share with us, with which version of Outlook you have saved this particular Message file.

Thank you


We are using outlook 2010, but the probleem seems to be cretaed by the fact that these messages now flow through exchange 2010. We used 2003 and there were no problems with these messages, but now we have multiple files that do not get saved… Please note we have this problem in our current production env. And we are lossing data… Please help! Might using the linkedresources collectin temporary help? What are side effects?


Hi Sander,

Could you please build and run the attached VS project at your end and see if you get any attachment.

At my end, I used VS 2008 on Windows 7 x64 and .NET framewoek 3.5. I can see 1 attachment in MailMessage.Attachments, but it does not seem to be valid. The file name is not correct and when saved to disk, it also produces invalid file.

cannot see any visual studio project attached.. Am I missing something?


sorry, forgot the attachment, here it is.

Hi Saqib,

this is almost the same code I have reported in this incident. I have no clue why you would like me re-try the message.attachements.count. It is zero. I run this on a windows 2008 sp2 64 bit machine. With outlook 2010 installed.

You stated you can reproduce the error. Appearently something wrong in the aspose.email and the aspose.network lib? Can we focus on that? Also can you advice on a workaround? As stated, we use aspose in our production environment and are currently losing data because attachements do not get saved and therefor not converted to pdf.

Could I be using the LinkedResources collection? What is the difference between linkedresources and attachments collection?

Please help!


Hi,Could you please inform us about our options? Are you guys trying to reproduce? Can I be of any assistance?



Hi Sander,

I can see one corrupted attachment as shared by Saqib when I use Load method with two parameters e.g.

MailMessage msg = MailMessage.Load("test.msg", MessageFormat.Msg)

and there are 0 attachments when I use Load method with one parameter e.g.

MailMessage msg = MailMessage.Load("test.msg");

This issue has been logged into our issue tracking system as NETWORKNET-31832. We will inform you as soon as we have any update on this issue. Sorry for the inconvenience.

Best Regards,

Hello Sander,

We need to find the right issue to be fixed, I used the above attached source and got Attachments.Count = 1, checked on Win7 x64 and Win 2008 R2 x64. But it was of no use because it was not showing the correct attachment, it shows ATT00000 as the attachment instead of the TIF file.

Please share a sample project with source that just uses the Aspose.Email code. Ideally the issue should be reproducable in the same way on yours and mine system, so that we will move forward fixing the right issue.

With my sample code and your test.msg file, I have already logged the bug (ID: 31832) for showing the invalid attachment (ATT00000) instead of TIF file.


thanx for your response. I am not conficed we are talking about the same issue. I have attached another msg file that does not show its attachements in msg.attachements collection. Only one and that is the security smime.p7m

Unfort. this message has many (jpg) attachments...Could you please verify this is the same problem?

We are using aspose now for several years without big problems. We shifted to exchange 2010 and now many msg-attachements's cannot be opened by aspose...

The attachements are not corrupt. They can be opened in either outlook 2007 and outlook 2010...


Hi Sanders,

I also see one attachment “smime.p7m” instead of multiple image files. Looks like it has something to do with the digital signatures, but anyhow, we will look into it in more detail and will inform you as soon as it gets fixed.

Can you fix this issue please? We experience major production problems. A roll back to Exchange 2003 isn't possible

Thank you


We are currently working on this issue. I will update you when I have any news and will try my best to get the fix available to you as soon as possible.


any news yet?


Hi Sander,

We have fixed the issue and plan to release the next version at the start of next week.

that is good news… can’t I get a pre - unsupported - version of that? :wink:

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

This message was posted using Notification2Forum from Downloads module by aspose.notifier.