About
Content-type is a email headers that defines:
- the type of the body
- or the type of one of the body parts
Example
Where the first parameter is the media type (mime)
Single part
- HTML
Content-Type: text/html; charset="UTF-8"
- Plain Text
Content-Type: text/plain; charset="UTF-8"
- A content that is a mime message (ie rfc822). ie a mail inside a mail
Content-Type: message/rfc822
- Delivery Status
Content-Type: message/delivery-status
- Attached Image
Content-Type: image/png; name="icon.png"
Content-Disposition: attachment; filename="icon.png"
Content-Transfer-Encoding: base64
Content-ID: <icon.png>
Multipart
Multipart media type means that the body is composed of multiple single part
- Multipart alternative. The parts are alternative to each other and represent the same content. The client can show one or the other part. Normally used to show a text if the client does not support HTML rendering.
Content-Type: multipart/alternative; boundary="0000000000008c12850607c40b30"
- Multipart related. The parts are related but do not represent the same content.
Content-Type: multipart/related; boundary="0000000000008c12780607c40b2f"
- Multipart report (in case of a bounce)
Content-Type: multipart/report; boundary="0000000000008c07b00607c40b27"; report-type=delivery-status
Syntax
It has the same functionality and syntax than the HTTP content type header
Namely:
Content-Type: mediaType; parameter1=value1; parameter2=value2
where:
- mediaType is the media type or mime
- parameters are extra information for the type