Does anybody know how to generate .mht file programmatically in C#, with embedded images in it? The thing is i have realised that .mht files are capable of embedding images in them, and this embedded images moves with the whole file(mht) when you change its location. And this file can be viewed on different browsers, including IE 6.
I was told to try Data Url Scheme technique. But it couldn't work because its not supported by other browsers. e.g IE 6.
An MHT file is a webpage archive saved by a web browser, such as Google Chrome or Microsoft Edge. It is saved in the MIME HTML or "MHTML" format, which stores HTML, CSS, JavaScript, images, and other linked resources into a single file.
MSDN has a great article (June 2011) about how to create an MHT file using both CDO and System.Net.Mail. C# source code is included in-full. I would use this above the VB.Net or Google Code version.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With