We need to send HTML mail which will embed all the images and style sheets. In order to achieve this we use MHT class. Everything is fine if we specify URL as source for converting: Mht::GetEmail( szURL );
But, unfortunately, our HTML page isn’t publicly available (it cannot be accessed through URL address) and there is no way to store it locally on the server. Hence, we need to create MHT web archive from in-memory HTML string by using the Mht::HtmlToMHT method. But, unfortunately, the method doesn’t embed any images (in base64 encoding).
We use the following code snippet:
Mht mht = new Mht();
mht.UnlockComponent("AnythingWorksFor30DayTrial");
mht.EmbedImages = true;
string szMht = mht.HtmlToMHT(szMyHtmlPage);
Chilkat.MailMan man = new Chilkat.MailMan();
man.UnlockComponent("AnythingWorksFor30DayTrial");
base.Email = man.LoadMime(szMht);