I have tried to reproduce this issue at my end using the latest version of Aspose.Email for .NET 3.3.0, but I am afraid to share that I couldn’t get success. It seems that the issue you have mentioned is related to some specific sample file at your end. Could you please share that for our investigation? We will look into it and assist you further as soon as possible.
Thank you for your time, but I can't give you any more information.
I just make a reference to the DLL, load the license and execute te code. Nothing more, but I keep getting the same error. Even after deleting all the Temporary ASP.Net files at 'C:\Windows\Microsoft.NET\Framework' and 'C:\Windows\Microsoft.NET\Framework64'. I even rebooted my PC.
Maby there is one thing that wel give you some ideas. When I first tried is it, did not wordt for a long time, but suddenly is did work after changing nothing. And almost immediately it did not work again, again after changing nothing. Very strange!
Maby you can tel me what you mean with 'some specific sample file', where must I look?
I assumed that this issue might be arising at your end with some particular MSG file as it is not reproducible at my end with a number of test MSG files that I tried. I tested this issue with a sample console application. However, after your feedback, I prepared a sample ASP.NET application but I am afraid the issue is still not reproducible. I have also attached the test application here for your reference. Please try it at your end and let us know your feedback.
I forgot to tell you that I'm using a ASP.NET application, so sorry for that. Now I think about it, there is more I didn't mention. I'm using Visual Studio 2012, .NET Framework 4.0 and the language is VB.
When I look at your test-application I see, that you are using different code than what I send you and I think that this is not the way to reproduce the error I'm getting. But I tried it the same way as in your code and I still get the same error, so this makes no difference at my end. I've added your code to my application and it wors perfectly, but you are creating you Mailmessage yourself. The Mailmessage I'm using comes from a mailbox (G-mail and Exchange) and when I use this Mailmessage in you code I get the same error. I also tryed it with the Aspose.Email.dll compiled for Framework 3.5 and 2.0, but this makes no difference. So I think you should try it again with a Mailmessage generated by an IMapClient object? I retrieve te Mailmessage as follows 'MailMessage = IMapClient.FetchMessage(sequenceNumber)'
I hope the new information helps you to reproduce the error
Thank you for providing the additional information.
I have re-tested this issue in light of your provided information with both Gmail as well as emails from Exchange server, but I’m afraid to share that this issue is still not reproducible at my end. Attached you can find an ASP.NET application that I have used to carry out the tests. Please try it at your end and let us know your feedback.
I finally solved the problem for my code, but I still think there is a bug in you library. It is all in the order on with you read from the MailMessage-object. In the past I first read all the linked resources and the attachments and then I tried to create the MSG-file. This order resulted in the error.
But now I first create the MSG-file and after that I read the rest. This does not result in an error.
So maybe you can try it this way to reproduce the error and see if there really is a bug?
Thank you for your time and I will wait for your reaction
I need little assistance to re-produce this issue as stated below.
voets:
It is all in the order on with you read from the MailMessage-object. In the past I first read all the linked resources and the attachments and then I tried to create the MSG-file. This order resulted in the error.
But now I first create the MSG-file and after that I read the rest. This does not result in an error."
Could you please provide us both the working and erroneous sample code that are used for above mentioned testing? These will help us to re-produce the issue and identify the problem.
Thanks in advance for your cooperation in this regard.
I have reproduced the issue here and have logged it in our bug tracking system as NETWORKNET-34100. Development team will look into it on its turn and will share their findings. You will be notified here as soon as some feedback is received by the developers.
Please feel free to write us back if you have any other query related to Aspose.Email.
Please refer to the following code sample which is actually the correct method of using streams and let us know your feedback in case your issue still persists.
Sample code:
foreach (Aspose.Email.Mail.LinkedResource linkedResource in mailMessage.LinkedResources)
{
using (MemoryStream newMemoryStream = new MemoryStream(