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

Open Source Software Forum

Get HTML string with embeded images

Hi Team,
We have created extension to get HTML string of outlook email(.msg).
We are rendering this HTML string in web application.
Our email is rendered as HTML correctly except inline images.
Below is our code.

        var fileBytes = File.ReadAllBytes("Sample.msg");
        Stream stream = new MemoryStream(fileBytes);         
        MailMessage message = MailMessage.Load(stream);
        var htmlString = message.HtmlBody;

Above code is giving HTML string as

When we save it as HTML then images are embedded as base 64-
message.Save(“output.html”, SaveOptions.DefaultHtml);
This is saving HTML as -
<img src="data:image/png;base64, …>

But we don’t want to save as HTML file we need HTML string with embedded images as base 64.

Best Regards,

This topic has been moved to the related forum: https://forum.aspose.com/t/get-html-string-with-embeded-images/268245