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

Free Support Forum - aspose.com

No attachments or weird ones when using MailMessage.Load(Stream stream)

Hi.
I have observed a weird behaviour when using the MailMessage.Load(Stream stream) method.
Here is code:

MailMessage messageContainer = MailMessage.Load(new MemoryStream(eml.Content));

Where eml.Content is a byte array holding the contents of the email.
The .eml file contains 4 attachments. A .txt, .docx, .jpg, and a .p7s.
When the code above has “loaded” the bytes then the attachments contain 2 files. One empty file called ATT00001.signed and the .txt file.

This obviously causes problems since some attachments are lost and that new file called ATT00001.signed was never there to beging with.

LinkedResources is empty as well.

@Simmi,

Thank you for contacting Aspose support team.

You may please send us the source byte array saved in a file. It will help us to observe the problem and provide assistance accordingly.

I think I may have found the problem.
I am using a very old version of the Aspose.Email for .NET. When I download and use the newest one in trial mode then the problem does not happen anymore and all the attachments are there.
I am guessing this was a bug before and has simply been fixed in newer versions.

@Simmi,

Thank you for providing feedback. Please feel free to write us back if you have any other query related to Aspose.Email.