This problem has burned me more than once in the past: I have a .mht, I double-click on it to load it into Internet Explorer, but instead of displaying the web page it displays the MIME source. It turns out the IE can’t handle .mht files that begin with the utf-8 preamble. These are the three bytes at the beginning of a utf-8 text file (0xEF 0xBB 0xBF). Remove those three bytes and all is OK.
I most recently ran across this problem with this C# MHT example. It downloads a web page and creates the MHT in-memory, then attaches it to an email and zips it (all in-memory) and sends the email…
Chilkat.Mht mht = new Chilkat.Mht();
mht.UnlockComponent("Anything for 30-day trial");
Chilkat.MailMan mailman = new Chilkat.MailMan();
mailman.UnlockComponent("Anything for 30-day trial");
mailman.SmtpHost = "smtp.comcast.net";
string mhtStr = mht.GetMHT("http://www.google.com");
Chilkat.Email email = new Chilkat.Email();
email.Subject = "This is a test";
email.Body = "This is the email body";
email.From = "Matt ";
// Add the MHT as an attachment.
// Use windows-1252 here:
// The MIME string contains nothing more than us-ascii characters
// because it is encoded (either quoted-printable or base64).
// If you use utf-8, the string will include the 3-byte utf-8
// preamble, and if the recipient extracts the MHT from the zipped
// email attachment to a file and the tries to load it in Internet Explorer,
// the MIME source will display. This is a bug in IE. It cannot handle
// the utf-8 preamble. If the utf-8 preamble is removed, IE loads and
// displays the MHT correctly. Therefore, use windows-1252 here to
// prevent that problem…
// Convert all attachments to a single zipped attachment.
bool success = mailman.SendEmail(email);