Message IDs (MIDs) and Content IDs (CIDs) are used to identify and refer to email messages and specific pieces of content within those messages. They are formally described in RFC 2392.
A Message ID (or MID) is used to refer to a specific message. MIDs are automatically assigned to messages and are required to be globally unique. In email headers an MID is provided as the
Message-ID field and enclosed between angle brackets. For example, here’s a MID for a message sent from GMail:
The domain from which the message is send is often seen at the end of the MID. Here’s an MID for another message sent from the same GMail account.
What about other services? Here are a couple of MIDs from messages sent via Amazon SES.
Message-ID: <firstname.lastname@example.org> Message-ID: <email@example.com>
An MID header can be translated into an MID URL by (1) adding a
mid: prefix and (2) URL-encoding. For example, the first MID above would translate to
mid:firstname.lastname@example.org. An MID URL would be used to refer to another message. For example:
Please refer to the <a href="mid:email@example.com">other message</a>.
A Content ID (or CID) refers to a specific piece of content within a message. In email headers a CID is provided as the
Content-ID field and enclosed between angle brackets.For example, the image in the MIME content below is assigned a CID of
Content-Type: image/gif; name="small-image.gif" Content-Disposition: inline; filename="small-image.gif" Content-Id: <part1.KiAFGCfk.B0ColWzg@gmail.com> Content-Transfer-Encoding: base64 R0lGODlhAgACAMIEAKJkSbFyVKB9dnaInQAAAAAAAAAAAAAAACH+EUNyZWF0ZWQgd2l0aCBH SU1QACH5BAEKAAQALAAAAAACAAIAAAMDGAKTADs=
A CID URL can be used to refer to the corresponding content from another part of the message. For example:
A CID is normally used to refer to other pieces of content within the same message. However, a CID can be combined with a MID to refer to content within another message. Note: When a MID and CID are combined, the result is still an MID. For example: