This requests a mime part's content to be encoded before being transmitted.
Upon multipart rendering, the part's content is encoded according to the pertaining scheme
and a corresponding "Content-Transfer-Encoding" header is added to the part.
Supported encoding schemes are:
binary
-
The data is left unchanged, the header is added.
8bit
-
Header added, no data change.
7bit
-
The data is unchanged, but is each byte is checked to be a 7-bit value; if not, a read error occurs.
base64
-
Data is converted to base64 encoding, then split in CRLF-terminated lines of at most 76 characters.
quoted-printable
-
Data is encoded in quoted printable lines of at most 76 characters. Since the resulting size of the
final data cannot be determined prior to reading the original data, it is left as unknown, causing
chunked transfer in HTTP. For the same reason, this encoder may not be used with IMAP. This encoder
targets text data that is mostly ASCII and should not be used with other types of data.
If the original data is already encoded in such a scheme, a custom Content-Transfer-Encoding header should
be added with mimepart:Headers() instead of setting a part encoder.
Encoding should not be applied to multiparts, thus the use of this function on a part with content set
with mimepart:Subparts() is strongly discouraged.