Create Headers for the Part

Create headers describing the content of the message. Create any protocol-specific headers the part requires.

Is the part body encoded, or 8-bit ASCII data, or binary data?

If so, create a Content-Transfer-Encoding header stating the datatype (for unencoded data) or the encoding (for encoded data). For example:

 

RWMimeContentTransferEncodingHeader

cTEHeader(RWMimeUtils::Base64);

Is the part body a content type other than plain text?

If so, create a Content-Type header stating the type of data. For example, the code snippet below creates a header for a JPEG image:

 

RWMimeContentType imageJPG("image", "jpeg");

RWMimeContentTypeHeader contentTypeHeader(imageJPG);

Will this part be a top-level message?

If so, create a default-constructed RWMimeVersionHeader.

 

RWMimeVersionHeader version;

MIME parts often require protocol-specific headers in addition to MIME headers. For example, email messages require a Date header and a From header. The RWMimeGenericHeader class represents a general-purpose header. If the part requires headers that aren’t part of the MIME format, use instances of RWMimeGenericHeader for those headers. For example, the line below creates a From header for an email message:

 

RWMimeGenericHeader from("From:", "Dev <developer@roguewave.com>");