Chilkat Email Components Home

Extract Data from MHT?

Back

Question:
Does your product knows how to read MHT files and extract the data from it?

Answer:
Yes, either Chilkat MHT can be used to unpack an MHT (similar to unzipping a .zip), or the Chilkat Email component can be used to open a .mht and access header fields, HTML text, embedded images, style sheets, etc.

This is a very important bit of information to know:
.eml files are identical to .mht files. The only difference is the filename extension.

Both simply contain MIME text. You can save (almost) any web page from Internet Explorer as a .mht (web archive), rename it by giving it a .eml extension, and then double-click on it. You’ll notice that the default application for .eml is Outlook Express. It will display the HTML “email”, but with no From, To, CC, or Subject. You may then add these and send the email.

With Chilkat, if you already have a .mht file, you may load it into an email object by calling Chilkat.Email.LoadEml (or Chilkat.Email.SetFromMimeText), then set the Subject & From properties, and then call AddTo/AddCC/AddBcc for each recipient, and send.

There is no source code associated with this article.