What is the message body of an email? (also known as Content)

About

The last part of the email message is called the body or the content of the message.

It is what the user will see.

Format

An email has a content part with a mime type (format) that is set with the content-type email header.

Example:

Content-Type: text/plain; charset=us-ascii
Content-Type: multipart/alternative; boundary="b1_QOvc4qkAfaq7Tgiq7M6THogyrrifARe0NIlLwqdmT4"

If the content mime type is a multipart type:

  • the email body content is then composed of multiple part that have also a mime type
  • otherwise the content is composed only of one part

Multipart

Multipart. ie an email may be composed of several part where each part has another associated mime (format)

List:

  • multipart/alternative when sending HTML and TEXT
  • multipart/mixed when sending TEXT and attachments.

Alternative

The format of advanced designed email is created in special email html document but plain text is always added in the message as a fallback because:

  • not every email client support html
  • or not every user want to see fancy email page

The content of the various parts is interchangeable. The client will show the LAST part if possible.

A body is then composed of a content that has the mime type multipart/alternative where:

  • the HTML part is shown if possible
  • otherwise, the plain-text part is shown

See RFC2046 (Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types) for details of the structure of such a message.

Example: complex multipart alternative with:

  • a text part
  • an html part with 2 subparts:
    • HTML markup
    • and inline image

The parts are delimited with a boundary and the base64 have been truncated but terminate with the classic ==

Content-Type: multipart/alternative; boundary="b1_QOvc4qkAfaq7Tgiq7M6THogyrrifARe0NIlLwqdmT4"

--b1_QOvc4qkAfaq7Tgiq7M6THogyrrifARe0NIlLwqdmT4
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: base64

SGVsbG8sCgpUaGlzIGlzIE1hcmssIE1lZGlhIFB1Ymxpc2hlciBvZiBUZWNoVGltZXMuY29tLiBb
VGVjaHRpbWVzLmNvbV0oaHR0cHM6Ly93d3cudGVjaHRpbWVzLmNvbS8pIHdpdGggNSBtaWxsaW9u
.................
.................
IERpZ2l0YWwgTWVkaWFdKGh0dHBzOi8vd3d3LnRlY2h0aW1lcy5jb20vKQ==
--b1_QOvc4qkAfaq7Tgiq7M6THogyrrifARe0NIlLwqdmT4
Content-Type: multipart/related; boundary="b2_QOvc4qkAfaq7Tgiq7M6THogyrrifARe0NIlLwqdmT4"; type="text/html"

--b2_QOvc4qkAfaq7Tgiq7M6THogyrrifARe0NIlLwqdmT4
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: base64

PGRpdiBzdHlsZT0iZm9udC1mYW1pbHk6IFZlcmRhbmEsIHNhbnMtc2VyaWY7IGZvbnQtc2l6ZTog
MTJweDsiPjxkaXY+PHNwYW4gc3R5bGU9ImZvbnQtZmFtaWx5OiBzeXN0ZW0tdWksIHNhbnMtc2Vy
aWY7IGZvbnQtc2l6ZTogMTRweDsgYmFja2dyb3VuZC1jb2xvcjogcmdiKDI1NSwgMjU1LCAyNTUp
.................
.................
bG9jay1lbXB0eSI+DQogICAgICAgIA0KICAgICAgICAgICAgPC9kaXY+DQo8L2Rpdj4NCg==
--b2_QOvc4qkAfaq7Tgiq7M6THogyrrifARe0NIlLwqdmT4
Content-Type: image/jpeg; name=image1697420268308
Content-Transfer-Encoding: base64
Content-ID: <[email protected]>
Content-Disposition: inline; filename=image1697420268308


--b2_QOvc4qkAfaq7Tgiq7M6THogyrrifARe0NIlLwqdmT4--
--b1_QOvc4qkAfaq7Tgiq7M6THogyrrifARe0NIlLwqdmT4--

Inline image

A part can be an inline image encoded in base64.

Example:

Content-Type: image/jpeg; name=image1697420268308
Content-Transfer-Encoding: base64
Content-ID: <[email protected]>
Content-Disposition: inline; filename=image1697420268308





Discover More
Email - Quoted Printable Encoding (3D, ..)

The quoted printable encoding is: an encoding scheme that is applied to the body of an email part and is given by the Content-Transfer-Encoding header. Raw form: In the Quoted-Printable...
HTML emails - How to write them correctly

There is a lot of fuzz concerning how you should write the HTML for email. This article will give you on the good track and this is not as scary as it seems
Java Conceptuel Diagram
Java - Jakarta Mail (JavaMail)

Jakarta Mail (previously known as JavaMail) is the basic / low level component of all email client implementation in Java. email server The following library are based on JavaMail and cache the...
The SMTP Protocol

A summary of what the SMTP protocol is and how to send an email from a network connection with telnet or netcat
What are email headers?

Email header are the most important part for email routing and this articles regroups the main logic about them
Gmail Show Original Email
What is a Email Message ? known as Internet Message or RFC822

An email is a document that is composed of the following structure * one or more headers * followed by a body that may be composed of multi-parts: * Text part * HTML part * Attachment and...
What is the Content-Disposition Header? (HTTP Save as, Email Attachment)

The content-disposition HTTP header indicates to the browser if the resource can be shown in the browser or should be downloaded (ie save as)
What is the Email Content-Type Header?

Content-type is a email headers that defines: the type of the body or the type of one of the body parts Where the first parameter is the media type (mime) HTML Plain Text A content that...
What is the MailX (Mail command)?

The mailx command is a client email (MUA) that is officially known as the Heirloom mailx . It supports: SMTP IMAP and POP With an Interactive shell and the to address : You can send an email...



Share this page:
Follow us:
Task Runner