MIME-Version: 1.0
From: Nathaniel Borenstein <nsb@nsb.fv.com>
To: Ned Freed <ned@innosoft.com>
Date: Fri, 07 Oct 1994 16:15:05 -0700 (PDT)
Subject: A multipart example
Content-Type: multipart/mixed;
            boundary=unique-boundary-1

This is the preamble area of a multipart message.
Mail readers that understand multipart format
should ignore this preamble.

If you are reading this text, you might want to
consider changing to a mail reader that understands
how to properly display multipart messages.

--unique-boundary-1

... Some text appears here ...

[Note that the blank between the boundary and the start
of the text in this part means no header fields were
given and this is text in the US-ASCII character set.
It could have been done with explicit typing as in the
next part.]

--unique-boundary-1
Content-type: text/plain; charset=US-ASCII

This could have been part of the previous part, but
illustrates explicit versus implicit typing of body
parts.

--unique-boundary-1
Content-Type: multipart/parallel; boundary=unique-boundary-2

--unique-boundary-2
Content-Type: audio/basic
Content-Transfer-Encoding: base64

... base64-encoded 8000 Hz single-channel
    mu-law-format audio data goes here ...

--unique-boundary-2
Content-Type: image/jpeg
Content-Transfer-Encoding: base64

... base64-encoded image data goes here ...

--unique-boundary-2--

--unique-boundary-1
Content-type: text/enriched

This is <bold><italic>enriched.</italic></bold>
<smaller>as defined in RFC 1896</smaller>

Isn't it
<bigger><bigger>cool?</bigger></bigger>

--unique-boundary-1
Content-Type: message/rfc822

From: (mailbox in US-ASCII)
To: (address in US-ASCII)
Subject: (subject in US-ASCII)
Content-Type: Text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: Quoted-printable

... Additional text in ISO-8859-1 goes here ...

--unique-boundary-1--

---- EXPECTED STRUCTURE ----
{
  "headers": {
    "content_type": {
      "ContentType": {
        "c_type": "multipart",
        "c_subtype": "mixed",
        "attributes": {
          "boundary": "unique-boundary-1"
        }
      }
    },
    "to": {
      "Address": {
        "name": "Ned Freed",
        "address": "ned@innosoft.com"
      }
    },
    "mime_version": {
      "Text": "1.0"
    },
    "from": {
      "Address": {
        "name": "Nathaniel Borenstein",
        "address": "nsb@nsb.fv.com"
      }
    },
    "subject": {
      "Text": "A multipart example"
    },
    "date": {
      "DateTime": {
        "year": 1994,
        "month": 10,
        "day": 7,
        "hour": 16,
        "minute": 15,
        "second": 5,
        "tz_before_gmt": true,
        "tz_hour": 7,
        "tz_minute": 0
      }
    }
  },
  "html_body": [
    {
      "contents": "<html><body>... Some text appears here ...<br/><br/>[Note that the blank between the boundary and the start<br/>of the text in this part means no header fields were<br/>given and this is text in the US-ASCII character set.<br/>It could have been done with explicit typing as in the<br/>next part.]<br/></body></html>"
    },
    {
      "contents": "<html><body>This could have been part of the previous part, but<br/>illustrates explicit versus implicit typing of body<br/>parts.<br/></body></html>"
    }
  ],
  "text_body": [
    {
      "contents": "... Some text appears here ...\n\n[Note that the blank between the boundary and the start\nof the text in this part means no header fields were\ngiven and this is text in the US-ASCII character set.\nIt could have been done with explicit typing as in the\nnext part.]\n"
    },
    {
      "headers": {
        "content_type": {
          "ContentType": {
            "c_type": "text",
            "c_subtype": "plain",
            "attributes": {
              "charset": "US-ASCII"
            }
          }
        }
      },
      "contents": "This could have been part of the previous part, but\nillustrates explicit versus implicit typing of body\nparts.\n"
    }
  ],
  "attachments": [
    {
      "Text": {
        "headers": {
          "content_type": {
            "ContentType": {
              "c_type": "audio",
              "c_subtype": "basic"
            }
          },
          "content_transfer_encoding": {
            "Text": "base64"
          }
        },
        "contents": "... base64-encoded 8000 Hz single-channel\n    mu-law-format audio data goes here ...\n"
      }
    },
    {
      "Text": {
        "headers": {
          "content_transfer_encoding": {
            "Text": "base64"
          },
          "content_type": {
            "ContentType": {
              "c_type": "image",
              "c_subtype": "jpeg"
            }
          }
        },
        "contents": "... base64-encoded image data goes here ...\n"
      }
    },
    {
      "Text": {
        "headers": {
          "content_type": {
            "ContentType": {
              "c_type": "text",
              "c_subtype": "enriched"
            }
          }
        },
        "contents": "This is <bold><italic>enriched.</italic></bold>\n<smaller>as defined in RFC 1896</smaller>\n\nIsn't it\n<bigger><bigger>cool?</bigger></bigger>\n"
      }
    },
    {
      "Message": {
        "headers": {
          "content_type": {
            "ContentType": {
              "c_type": "text",
              "c_subtype": "plain",
              "attributes": {
                "charset": "ISO-8859-1"
              }
            }
          },
          "from": {
            "Address": {
              "name": "mailbox in US-ASCII"
            }
          },
          "subject": {
            "Text": "(subject in US-ASCII)"
          },
          "to": {
            "Address": {
              "name": "address in US-ASCII"
            }
          },
          "content_transfer_encoding": {
            "Text": "Quoted-printable"
          }
        },
        "html_body": [
          {
            "contents": "<html><body>... Additional text in ISO-8859-1 goes here ...<br/></body></html>"
          }
        ],
        "text_body": [
          {
            "contents": "... Additional text in ISO-8859-1 goes here ...\n"
          }
        ]
      }
    }
  ]
}