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

Free Support Forum - aspose.com

Include inline attachment while creating message file

Does aspose provide options to create message file with embedded files? Using following link, I am able to include regular attachments only.



I suggest you to please visit the following link for your convenience to add inline attachments in MSG.

Thanks, it worked.

I have one more questions.
I have RtfCompressed data(in bytes) which comes from other sdk. Is it possible to use this value to render the body while creating message file?


We will need a working sample project to analyze this before sharing any comments on this.

Sample utility and pst file are attached.PstProcessingUtility.zip (5.0 MB)


Also above solution “How to Add an inline image as attachment in MailMessage/ MapiMessage”
works if message body type is HTML. How to handle same for RTF formatted body as I am now able to get decompressed rtf body from RtfCompressed data. ?

In above utility, following code decompressed the RtfCompressed data.

                var decomp = new RtfDecompressor();

                using (System.IO.MemoryStream ms = decomp.Decompress(xstMessage.RtfCompressed, true))
                    ms.Position = 0;
                    byte[] rtfDecompressed = ms.ToArray();
                    rtfBody = Encoding.UTF8.GetString(rtfDecompressed, 0, rtfDecompressed.Length);


We need to investigate the requirement for adding inline attachment to RTFDecompressed data and I have added an issue with ID EMAILNET-39948 in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.

Is this issue fixed? in which version it will be included?


It has been marked as fixed in present Aspose.Email for .NET 20.10. Can you please check the specified version on your end.

Can you please share code snippet for this?


Can you please check the attached solution.
ConsoleApp1.zip (34.1 KB)