To start with, the reply message should do the following things (which are all convention more than anything else):
- The replied message's
To
header should be set to the original message'sReply-To
value, if set, otherwise to theFrom
value. - The reply message's
Subject
header should be set to the value of the original message'sSubject
header, but with a"Re: "
prefix (unless it already has one). - The reply message's
In-Reply-To
header should be set to the original message'sMessage-Id
header value. - The reply message's
References
header should be set to the original message'sReferences
header value with the original message'sMessage-Id
value appended to it.
That takes care of the headers. For the message body, that will depend on whether the message body you are replying to is in text/plain
or text/html
format.
Since there's no real convention for text/html
messages, I'll explain the convention for text/plain
replies instead.
Normally, what you do, as the author of an email client is to construct a default reply text body in the following format:
On ${TIMESTAMP}, ${AUTHOR_NAME} wrote:
followed by the original message text with each line prefixed with "> "
(greater-than space).
Depending on the mail client, the ${TIMESTAMP} string will be formatted differently, but it'll often be more-or-less the same format as the original message's Date
header.
The author's name, of course, is taken from the parsed email address in the From
header.
If you are auto-generating a reply to a message, it'll probably easiest to prepend the reply text to the "quoted" original message body text (which is often referred to as top-posting), but there are other styles that some people use when replying manually.