Search⌘ K
AI Features

Email: Message Format

Explore the format of email messages, focusing on the essential header lines such as To, From, and Subject, along with the message body. Understand how email headers carry important metadata and how they relate to email protocols and servers.

Introduction

Email messages have a format the same way that HTTP request and response messages do. Let’s dive right into it.

Header Lines

Email messages start with header lines, much akin to HTTP. The header lines contain important metadata about the email.

  • The header lines consist of keywords followed by a colon, followed by a value.
  • Every header line is separated by a new line with a carriage return (\r).
  • Every header must have the To: and From: header lines.
  • The rest of the headers, including the subject: header line, are optional.

Message Body

The message body of the email follows the header lines after a blank line.

Here is an example of what an email message looks like:

Exercise: View

...