About MIME And Its MIME Parts

E-mail can transfer only text based messages for historical reasons. All protocols for the transfer of e-mail are text based.

MIME enhances this model. MIME is way to encode any information in an acceptable format for the transfer layer: to text-based content in the case of e-mail. But it can also do more. You can send multiple text or binary information parts in one message.

The basic element of MIME is the Part. Each part knows its type, and all the needed information about its content. There are these major types of Parts:

  • Text Part - contains textual information for reading by human. This Part also understands the charset used.
  • Binary part - contains any binary data, like executable file, picture, sound etc.
  • Message part - contains full nested another mail message.
  • Multipart part - is special Part type. It is just a container for one or more nested Parts.

Nested parts can be any Part type including another Multipart. With Multiparts you can create any tree structure of parts.

Each e-mail message has one root part. If this root part is a text part, then the message can hold only text. But when you need to encode text and some binary part, your root part must be a multipart which comprises two nested parts (subparts): text and binary.

Schema:

1 multipart (mixed type)
   1.1 text part
   1.2 binary part attachment

When you need to send an HTML message with one picture (and the plain text variant of the HTML content), then your root is a Multipart comprising your plain text part and a multipart comprising the HTML text part and the binary image part.

Schema:

1 multipart (alternative type)
   1.1 text part
   1.2 multipart (related type)
      1.2.1 text part with HTML content
      1.2.2 binary part with picture for HTML part
public/howto/mimeparts.txt · Last modified: 2007/11/30 14:30 (external edit)
Driven by DokuWiki Recent changes RSS feed