Free Support Forum -

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 (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.