I have an mht file I’m trying to email from my website. Not clear the best way. Can you recommend?
asked Sep 30 '14 at 09:51
MHT and EML (email) are both MIME. MIME is a format that is fundamental to much of Internet communications and technologies, and therefore it's a good thing to know the basics of it. For example, HTTP requests and responses are also MIME.
The only difference between MHT and EML is the intent for how the MIME is to be used. In the case of EML, it is for email and therefore the MIME headers will include fields such as Subject, To, From, etc. In the case of MHT, it is an HTML web archive with the HTML images embedded within the MIME as "related items". The MHT will not contain headers such as Subject, To, From, etc.
EML and MHT embed HTML images within the MIME in the exact same way. The images are located under the multipart/related enclosure, and they are referenced from within the HTML as either Content-ID's or URLs (using Content-Location's).
Given that the files are the same format (except for differences in what headers are present), the reason for naming one "MHT" and the other "EML" is so that each has a different file extension and thus can have different default programs associated with them (.mht is associated with Internet Explorer, and .eml is associated with your default email client, such as Thunderbird).
You should be able to right-click on a .mht and open it in Thunderbird. You'll see the "email" but without Subject, recipients, From address, etc.
If your MHT contains HTML that is reasonable, then it's only a matter of loading the .mht into a Chilkat.Email object via the LoadEml method, set the Subject and From properties. Add some recipients by calling AddTo, AddCC, etc. one or more times, and then send.
answered Sep 30 '14 at 10:05