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

Free Support Forum - aspose.app

Should SaveFormat MHTML include cid in inline image SRC

The use case is Word Template -> SaveFormat.MHTML to EMAIL
The MHTML “mime” format converts very nicely.

Being forced by Microsoft oAuth changes to switch from .NET Mail.Message to ones that support oAuth.

The inline image are now broken, and the email client provider says it is because you don’t have cid: in your inline image tags.

<img src=3D"image.001.jpeg" width=3D"225" height=3D"110" alt=3D"" />

should be
<img src=3D"cid:image.001.jpeg" width=3D"225" height=3D"110" alt=3D"" />

Sample code below requires a simple word template with an embedded image (like a logo):

  static void Main(string[] args)
        Aspose.Words.License wordLicense = new License();

        Aspose.Words.Document wd = new Aspose.Words.Document("Template.docx");

        wd.Save("f:\\tmhtml\\wd.mhtml", SaveFormat.Mhtml);

This topic has been moved to the related forum: https://forum.aspose.com/t/should-saveformat-mhtml-include-cid-in-inline-image-src/252775