Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Content Type for MHT files

What is the content type for MHT files?

like image 497
Krishna Kumar Avatar asked Aug 27 '08 20:08

Krishna Kumar


4 Answers

Microsoft, who co-authored the spec for MHT, seem to think that it should be 'message/rfc822' on this support page.

No specific MIME type seems to be given in the spec though: RFC2557: MIME Encapsulation of Aggregate Documents, such as HTML (MHTML)

like image 119
Luke Quinane Avatar answered Sep 30 '22 06:09

Luke Quinane


I know this is old, but I thought it should be clarified and explained in more detail...

@Guy Starbuck wrote:

message/rfc822

RFC 822 - STANDARD FOR THE FORMAT OF ARPA INTERNET TEXT MESSAGES

The problem with this answer is that MHTML files are not defined by RFC822.

The correct content-type for MHTML files (.mht, .mhtml) is multipart/related.

As stated above, RFC822 defines the format for internet text messages. The content-type message/rfc822 is used for text attachments within email messages [1][2].

Most of us have probably received a reply to an email where, instead of being quoted inline, the original message is included as an attachment. That attachment has a content-type of message/rfc822. In such emails, the content-types break down as follows:

  • multipart/mixed = entire message
  • text/plain = text of reply email
  • message/rfc822 = original email as attachment

On the other hand, as noted by @feeela, MHTML files are defined in RFC2557. MHTML files are comprised of many different parts, each of which can have a different content-type. However, RFC2557 defines the content-type of the entire file as multipart/related.

[1] RFC1341: MIME (Multipurpose Internet Mail Extensions)
[2] The message Content-Type

like image 41
geo Avatar answered Sep 30 '22 07:09

geo


"MIME Encapsulation of Aggregate Documents, such as HTML" (MHTML or MHT) is an IETF standard proposed in 1999 in the RFC 2557.

Its MIME type is multipart/related and the extension is .mht.

See also:

  • https://www.rfc-editor.org/rfc/rfc2557
  • http://en.wikipedia.org/wiki/MHTML
like image 36
feeela Avatar answered Sep 30 '22 08:09

feeela


message/rfc822

RFC 822 - STANDARD FOR THE FORMAT OF ARPA INTERNET TEXT MESSAGES

Here is a hyperlink: message/rfc822

like image 35
Guy Starbuck Avatar answered Sep 30 '22 08:09

Guy Starbuck