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

Free Support Forum - aspose.com

Importing MailMessage from MemoryStream

I’m using Aspose.Network

I’m receiving the following error when trying to Import a MailMessage item into a MailMessage item via a memory stream.
“Invalid MIME foramt: header is empty.” (‘foramt’ is not a spelling mistake)

I’m writing to a memory stream using the MailMessage.Save(stream) and then using the same stream to load it into a new MailMessage using the Import function.

MemoryStream memoryStream = new MemoryStream();

The templateMail headers field contains 6 entries.


Hi Leo,

Thanks for considering Aspose.

Before calling Import() method, please set the position of the stream to 0.

stream.Position = 0;