-->
New issue commented
commented
commented
commented
commented
commented
commented
commented
commented
commented
![Base64 encoding java Base64 encoding java](/uploads/1/2/3/7/123741664/156647327.jpg)
Inheritance
- How To Read Content Transfer Encoding Base64
- Decode Content Transfer Encoding Base64
- Base64 Encoding Java
Base64 encoding is the scheme used to transmit binary data. Base64 processes data as 24-bit groups, mapping this data to four encoded characters. It is sometimes referred to as 3-to-4 encoding. Each 6 bits of the 24-bit group is used as an index into a mapping table (the base64 alphabet) to obtain a character for the encoded data. The encoded data has line lengths limited to 76 characters. The characters used in base64 encoding, the base64 alphabet, include none of the special characters of importance to SMTP or the hyphen used with Multipurpose Internet Mail Extensions (MIME) boundary strings.
Internet protocol suite |
---|
Application layer |
Transport layer |
Internet layer |
|
Link layer |
|
Multipurpose Internet Mail Extensions (MIME) is an Internet standard that extends the format of email to support:
- Text in character sets other than ASCII
- Non-text attachments: audio, video, images, application programs etc.
- Message bodies with multiple parts
- Header information in non-ASCII character sets
Virtually all human-written Internet email and a fairly large proportion of automated email is transmitted via SMTP in MIME format.[citation needed]
MIME is specified in six linked RFC memoranda: RFC 2045,RFC 2046,RFC 2047,RFC 4288,RFC 4289 and RFC 2049; with the integration with SMTP email specified in detail in RFC 1521 and RFC 1522.
Although MIME was designed mainly for SMTP, the content types defined by MIME standards are also of importance in communication protocols outside of email, such as HTTP for the World Wide Web. Servers insert the MIME header at the beginning of any Web transmission. Clients use this content type or media type header to select an appropriate viewer application for the type of data the header indicates. Some of these viewers are built into the Web client or browser (for example, almost all browsers come with GIF and JPEG image viewers as well as the ability to handle HTML files).
- 1MIME headers
- 2Encoded-Word
- 3Multipart messages
- 3.1Multipart subtypes
- 5References
MIME headers[edit]
MIME-Version[edit]
The presence of this header indicates the message is MIME-formatted. The value is typically '1.0' so this header appears as
According to MIME co-creator Nathaniel Borenstein, the intention was to allow MIME to change, to advance to version 2.0 and so forth, but this decision led to the opposite outcome, making it nearly impossible to create a new version of the standard.
'We did not adequately specify how to handle a future MIME version,' Borenstein said. 'So if you write something that knows 1.0, what should you do if you encounter 2.0 or 1.1? I sort of thought it was obvious but it turned out everyone implemented that in different ways. And the result is that it would be just about impossible for the Internet to ever define a 2.0 or a 1.1.'[1]
Content-Type[edit]
This header indicates the media type of the message content, consisting of a type and subtype, for example
Through the use of the multipart type, MIME allows mail messages to have parts arranged in a tree structure where the leaf nodes are any non-multipart content type and the non-leaf nodes are any of a variety of multipart types.This mechanism supports:
- simple text messages using text/plain (the default value for 'Content-Type: ')
- text plus attachments (multipart/mixed with a text/plain part and other non-text parts). A MIME message including an attached file generally indicates the file's original name with the 'Content-disposition:' header, so the type of file is indicated both by the MIME content-type and the (usually OS-specific) filename extension
- reply with original attached (multipart/mixed with a text/plain part and the original message as a message/rfc822 part)
- alternative content, such as a message sent in both plain text and another format such as HTML (multipart/alternative with the same content in text/plain and text/html forms)
- image, audio, video and application (for example, image/jpeg, audio/mp3, video/mp4, and application/msword and so on)
- many other message constructs
Content-Disposition[edit]
The original MIME specifications only described the structure of mail messages. They did not address the issue of presentation styles. The content-disposition header field was added in RFC 2183 to specify the presentation style. A MIME part can have:
- an inline content-disposition, which means that it should be automatically displayed when the message is displayed, or
- an attachment content-disposition, in which case it is not displayed automatically and requires some form of action from the user to open it.
In addition to the presentation style, the content-disposition header also provides fields for specifying the name of the file, the creation date and modification date, which can be used by the reader's mail user agent to store the attachment.
The following example is taken from RFC 2183, where the header is defined
The filename may be encoded as defined by RFC 2231.
How To Read Content Transfer Encoding Base64
As of 2010, a good majority of mail user agents do not follow this prescription fully. The widely used Mozilla Thunderbird mail client makes its own decisions about which MIME parts should be automatically displayed, ignoring the content-disposition headers in the messages. Thunderbird prior to version 3 also sends out newly composed messages with inline content-disposition for all MIME parts. Most users are unaware of how to set the content-disposition to attachment.[2] Many mail user agents also send messages with the file name in the name parameter of the content-type header instead of the filename parameter of the content-disposition header. This practice is discouraged – the file name should be specified either through just thefilename parameter, or through both the filename and the name parameters.[3]
In HTTP, the
Content-Disposition: attachment
response header is usually used to hint to the client to present the response body as a downloadable file. Typically, when receiving such a response, a Web browser will prompt the user to save its content as a file instead of displaying it as a page in a browser window, with the filename parameter suggesting the default file name (this is useful for dynamically generated content, where deriving the filename from the URL may be meaningless or confusing to the user).Content-Transfer-Encoding[edit]
In June 1992, MIME (RFC 1341, since made obsolete by RFC 2045) defined a set of methods for representing binary data in formats other than ASCII text format. The content-transfer-encoding: MIME header has 2-sided significance:
- It indicates whether or not a binary-to-text encoding scheme has been used on top of the original encoding as specified within the Content-Type header:
- If such a binary-to-text encoding method has been used, it states which one.
- If not, it provides a descriptive label for the format of content, with respect to the presence of 8-bit or binary content.
The RFC and the IANA's list of transfer encodings define the values shown below, which are not case sensitive. Note that '7bit', '8bit', and 'binary' mean that no binary-to-text encoding on top of the original encoding was used. In these cases, the header is actually redundant for the email client to decode the message body, but it may still be useful as an indicator of what type of object is being sent. Values 'quoted-printable' and 'base64' tell the email client that a binary-to-text encoding scheme was used and that appropriate initial decoding is necessary before the message can be read with its original encoding (e.g. UTF-8).
- Suitable for use with normal SMTP:
- 7bit – up to 998 octets per line of the code range 1.127 with CR and LF (codes 13 and 10 respectively) only allowed to appear as part of a CRLF line ending. This is the default value.
- quoted-printable – used to encode arbitrary octet sequences into a form that satisfies the rules of 7bit. Designed to be efficient and mostly human readable when used for text data consisting primarily of US-ASCII characters but also containing a small proportion of bytes with values outside that range.
- base64 – used to encode arbitrary octet sequences into a form that satisfies the rules of 7bit. Designed to be efficient for non-text 8 bit and binary data. Sometimes used for text data that frequently uses non-US-ASCII characters.
- Suitable for use with SMTP servers that support the 8BITMIMESMTP extension (RFC 6152):
- 8bit – up to 998 octets per line with CR and LF (codes 13 and 10 respectively) only allowed to appear as part of a CRLF line ending.
- Suitable for use with SMTP servers that support the BINARYMIME SMTP extension (RFC 3030):
- binary – any sequence of octets.
There is no encoding defined which is explicitly designed for sending arbitrary binary data through SMTP transports with the 8BITMIME extension. Thus, if BINARYMIME isn't supported, base64 or quoted-printable (with their associated inefficiency) are sometimes still useful. This restriction does not apply to other uses of MIME such as Web Services with MIME attachments or MTOM.
Encoded-Word[edit]
Since RFC 2822, conforming message header names and values should be ASCII characters; values that contain non-ASCII data should use the MIME encoded-word syntax (RFC 2047) instead of a literal string. This syntax uses a string of ASCII characters indicating both the original character encoding (the 'charset') and the content-transfer-encoding used to map the bytes of the charset into ASCII characters.
The form is: '
=?
charset?
encoding?
encoded text?=
'.- charset may be any character set registered with IANA. Typically it would be the same charset as the message body.
- encoding can be either '
Q
' denoting Q-encoding that is similar to the quoted-printable encoding, or 'B
' denoting base64 encoding. - encoded text is the Q-encoded or base64-encoded text.
- An encoded-word may not be more than 75 characters long, including charset, encoding, encoded text, and delimiters. If it is desirable to encode more text than will fit in an encoded-word of 75 characters, multiple encoded-words (separated by CRLF SPACE) may be used.
Difference between Q-encoding and quoted-printable[edit]
The ASCII codes for the question mark ('?') and equals sign ('=') may not be represented directly as they are used to delimit the encoded-word. The ASCII code for space may not be represented directly because it could cause older parsers to split up the encoded word undesirably. To make the encoding smaller and easier to read the underscore is used to represent the ASCII code for space creating the side effect that underscore cannot be represented directly. Use of encoded words in certain parts of headers imposes further restrictions on which characters may be represented directly.
For example,
Subject: =?iso-8859-1?Q?=A1Hola,_se=F1or!?=
is interpreted as 'Subject: ¡Hola, señor!'.
The encoded-word format is not used for the names of the headers (for example
Subject
). These header names are always in English in the raw message. When viewing a message with a non-English email client, the header names are usually translated by the client.Multipart messages[edit]
The MIME multipart message contains a boundary in the 'Content-Type: ' header; this boundary, which must not occur in any of the parts, is placed between the parts, and at the beginning and end of the body of the message, as follows:
Each part consists of its own content header (zero or more Content- header fields) and a body. Multipart content can be nested. The content-transfer-encoding of a multipart type must always be '7bit', '8bit' or 'binary' to avoid the complications that would be posed by multiple levels of decoding. The multipart block as a whole does not have a charset; non-ASCII characters in the part headers are handled by the Encoded-Word system, and the part bodies can have charsets specified if appropriate for their content-type.
Notes:
- Before the first boundary is an area that is ignored by MIME-compliant clients. This area is generally used to put a message to users of old non-MIME clients.
- It is up to the sending mail client to choose a boundary string that doesn't clash with the body text. Typically this is done by inserting a long random string.
- The last boundary must have two hyphens at the end.
Multipart subtypes[edit]
The MIME standard defines various multipart-message subtypes, which specify the nature of the message parts and their relationship to one another. The subtype is specified in the 'Content-Type' header of the overall message. For example, a multipart MIME message using the digest subtype would have its Content-Type set as 'multipart/digest'.
The RFC initially defined 4 subtypes: mixed, digest, alternative and parallel. A minimally compliant application must support mixed and digest; other subtypes are optional. Applications must treat unrecognized subtypes as 'multipart/mixed'. Additional subtypes, such as signed and form-data, have since been separately defined in other RFCs.
The following is a list of the most commonly used subtypes; it is not intended to be a comprehensive list.
Mixed[edit]
Multipart/mixed is used for sending files with different 'Content-Type' headers inline (or as attachments). If sending pictures or other easily readable files, most mail clients will display them inline (unless otherwise specified with the 'Content-disposition' header). Otherwise it will offer them as attachments. The default content-type for each part is 'text/plain'.
Defined in RFC 2046, Section 5.1.3
Digest[edit]
Multipart/digest is a simple way to send multiple text messages. The default content-type for each part is 'message/rfc822'.
Defined in RFC 2046, Section 5.1.5
Alternative[edit]
The multipart/alternative subtype indicates that each part is an 'alternative' version of the same (or similar) content, each in a different format denoted by its 'Content-Type' header. The order of the parts is significant. RFC1341 states that: In general, user agents that compose multipart/alternative entities should place the body parts in increasing order of preference, that is, with the preferred format last.[4]
Systems can then choose the 'best' representation they are capable of processing; in general, this will be the last part that the system can understand, although other factors may affect this.
Since a client is unlikely to want to send a version that is less faithful than the plain text version, this structure places the plain text version (if present) first. This makes life easier for users of clients that do not understand multipart messages.
Most commonly, multipart/alternative is used for email with two parts, one plain text (text/plain) and one HTML (text/html). The plain text part provides backwards compatibility while the HTML part allows use of formatting and hyperlinks. Most email clients offer a user option to prefer plain text over HTML; this is an example of how local factors may affect how an application chooses which 'best' part of the message to display.
While it is intended that each part of the message represent the same content, the standard does not require this to be enforced in any way. At one time, anti-spam filters would only examine the text/plain part of a message,[citation needed] because it is easier to parse than the text/html part. But spammers eventually took advantage of this, creating messages with an innocuous-looking text/plain part and advertising in the text/html part. Anti-spam software eventually caught up on this trick, penalizing messages with very different text in a multipart/alternative message.[citation needed]
Defined in RFC 2046, Section 5.1.4
Related[edit]
A multipart/related is used to indicate that each message part is a component of an aggregate whole. It is for compound objects consisting of several inter-related components - proper display cannot be achieved by individually displaying the constituent parts. The message consists of a root part (by default, the first) which reference other parts inline, which may in turn reference other parts. Message parts are commonly referenced by the 'Content-ID' part header. The syntax of a reference is unspecified and is instead dictated by the encoding or protocol used in the part.
One common usage of this subtype is to send a web page complete with images in a single message. The root part would contain the HTML document, and use image tags to reference images stored in the latter parts.
Defined in RFC 2387
Report[edit]
Multipart/report is a message type that contains data formatted for a mail server to read. It is split between a text/plain (or some other content/type easily readable) and a message/delivery-status, which contains the data formatted for the mail server to read.
Defined in RFC 6522
Signed[edit]
A multipart/signed message is used to attach a digital signature to a message. It has exactly two body parts, a body part and a signature part. The whole of the body part, including mime headers, is used to create the signature part. Many signature types are possible, like 'application/pgp-signature' (RFC 3156) and 'application/pkcs7-signature' (S/MIME).
Defined in RFC 1847, Section 2.1
Encrypted[edit]
A multipart/encrypted message has two parts. The first part has control information that is needed to decrypt the application/octet-stream second part. Similar to signed messages, there are different implementations which areidentified by their separate content types for the control part. The most common types are'application/pgp-encrypted' (RFC 3156) and 'application/pkcs7-mime' (S/MIME).
Defined in RFC 1847, Section 2.2
Form-Data[edit]
As its name implies, multipart/form-data is used to express values submitted through a form. Originally defined as part of HTML 4.0, it is most commonly used for submitting files via HTTP.
Defined in RFC 7578 (previously RFC 2388)
Mixed-Replace[edit]
The content type multipart/x-mixed-replace was developed as part of a technology to emulate server push and streaming over HTTP.
All parts of a mixed-replace message have the same semantic meaning. However, each part invalidates - 'replaces' - the previous parts as soon as it is received completely. Clients should process the individual parts as soon as they arrive and should not wait for the whole message to finish.
Originally developed by Netscape,[5] it is still supported by Mozilla, Firefox, Safari, and Opera. It is commonly used in IP cameras as the MIME type for MJPEG streams.[6] It was supported by Chrome for main resources until 2013 (images can still be displayed using this content type).[7]
Byteranges[edit]
The multipart/byterange is used to represent noncontiguous byte ranges of a single message. It is used by HTTP when a server returns multiple byte ranges and is defined in RFC 2616.
See also[edit]
- Direct Internet Message Encapsulation (DIME)– a now superseded Microsoft-proposed protocol intended as a streamlined MIME, primarily for use in web services.
- Extended SMTP (ESMTP)
- Object Linking and Embedding (OLE)
References[edit]
Citations[edit]
- ^'History of MIME'. networkworld.com. February 2011.
- ^Giles Turnbull (2005-12-14). 'Forcing Thunderbird to treat outgoing attachments properly'. O'Reilly mac devcenter. Retrieved 2010-04-01.
- ^Ned Freed (2008-06-22). 'name and filename parameters'. Retrieved 2017-04-03.
- ^'RFC1341 Section 7.2 The Multipart Content-Type'. Retrieved 2014-07-15.
- ^'An Exploration of Dynamic Documents'. Netscape. Archived from the original on 1998-12-03.
- ^'WebCam Monitor setup documentation'. DeskShare. Archived from the original on 2010-05-17.
- ^'249132 - Remove support for multipart/x-mixed-replace main resources - chromium - Monorail'. bugs.chromium.org. Retrieved 2017-10-10.
Sources[edit]
- RFC 1426
- SMTP Service Extension for 8bit-MIMEtransport. J. Klensin, N. Freed, M. Rose, E. Stefferud, D. Crocker. February 1993.
- RFC 1847
- Security Multiparts for MIME: Multipart/Signed and Multipart/Encrypted
- RFC 3156
- MIME Security with OpenPGP
- RFC 2045
- MIME Part One: Format of Internet Message Bodies.
- RFC 2046
- MIME Part Two: Media Types. N. Freed, Nathaniel Borenstein. November 1996.
- RFC 2047
- MIME Part Three: Message Header Extensions for Non-ASCII Text. Keith Moore. November 1996.
- RFC 4288
- MIME Part Four: Media Type Specifications and Registration Procedures.
- RFC 4289
- MIME Part Four: Registration Procedures. N. Freed, J. Klensin. December 2005.
- RFC 2049
- MIME Part Five: Conformance Criteria and Examples. N. Freed, N. Borenstein. November 1996.
- RFC 2183
- Communicating Presentation Information in Internet Messages: The Content-Disposition Header. Troost, R., Dorner, S. and K. Moore. August 1997.
- RFC 2231
- MIME Parameter Value and Encoded Word Extensions: Character Sets, Languages, and Continuations. N. Freed, K. Moore. November 1997.
- RFC 2387
- The MIME Multipart/Related Content-type
- RFC 1521
- Mechanisms for Specifying and Describing the Format of Internet Message Bodies
Further reading[edit]
- Hughes, L (1998). Internet Email Protocols, Standards and Implementation. Artech House Publishers. ISBN978-0-89006-939-4.
- Johnson, K (2000). Internet Email Protocols: A Developer's Guide. Addison-Wesley Professional. ISBN978-0-201-43288-6.
- Loshin, P (1999). Essential Email Standards: RFCs and Protocols Made Practical. John Wiley & Sons. ISBN978-0-471-34597-8.
- Rhoton, J (1999). Programmer's Guide to Internet Mail: SMTP, POP, IMAP, and LDAP. Elsevier. ISBN978-1-55558-212-8.
- Wood, D (1999). Programming Internet Mail. O'Reilly. ISBN978-1-56592-479-6.
External links[edit]
- MIME Media Types - comprising a list of directories of content types and subtypes, maintained by Internet Assigned Numbers Authority.
- 'The MIME guys: How two Internet gurus changed e-mail forever'. February 1, 2011.
Retrieved from 'https://en.wikipedia.org/w/index.php?title=MIME&oldid=891254387'
Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upHave a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
commented May 20, 2016 • edited
edited
in class.phpmailer.php createBody() there are a few conditions that will switch the encoding to quoted-printable, without first checking to see if the email has a multi-part message. Which breaks the fix in version 2.5.8 |
commented May 20, 2016
Could you be a bit more precise or write a test case? The automatic switch to quoted-printable only applies to the individual sub-parts (in $bodyEncoding and $altBodyEncoding ), not the enclosing multipart (which retains whatever encoding you set). |
commented May 20, 2016
I think I see what you mean here. |
commented May 20, 2016
Yes, that is one of the lines, but in general I think anything that changes the encoding to quoted-printable should first check to see if the message is multi-part. The following appears to have fixed the issue for me: //check if is multi-part before switching to quoted-printable //getMailMIME should also be modified to use isMultipart() |
commented May 20, 2016
No you don't need to do all that, switching to Q-P for the sub-parts isn't a problem, it's only not allowed on the enclosing multipart. The only place it matters is where Encoding is set at that line I pointed at, and I don't think it should be. Try commenting that line out and see if it fixes your issue. |
commented May 20, 2016
To get the email to work properly, I had to comment out both lines: If it helps, the message_type is 'alt' and there are two message parts: text/plain & text/html. When viewing the email in Outlook 2010 and viewing the email in Office365 via my browser, the quoted-printable encoding isn't decoded properly. This appears to happen for any sub-part encoded with 'quoted-printable' - maybe it's an issue with those clients. |
commented May 20, 2016
Doing that will result in messages that have lines that are too long, which is why we're doing this switch in the first place - it's the same thing that Apple Mail does in the same situation. QP encoding is lossless, so you can break long lines without affecting the decoded content. You can avoid the entire situation in 2 ways: wrap your content so lines are shorter than 76 chars, or set Encoding = 'base64'; .It does appear that Outlook (both desktop and web versions) is buggy with respect to quoted-printable encoding - see #606 - but this seems to be the result of filtering it applies before you receive it rather than something being wrong with the original message - you will see that the message you receive is not what you sent (try BCCing the message to gmail to compare). Outlook has been getting steadily worse - the last half-decent version was 2003! |
commented May 22, 2016
I didn't quite intend to close this ticket with that commit, but I think it should fix your problem - can you confirm? |
commented May 25, 2016
Decode Content Transfer Encoding Base64
It doesn't fix the issue for me. |
commented May 25, 2016
![Base64 encoding java Base64 encoding java](/uploads/1/2/3/7/123741664/156647327.jpg)
There were a couple of other changes after that commit that should make QP encoding more consistent. Comments on the #606 bug say that most of their problems are avoided by using base64 encoding. |
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment
-->Applies to: Exchange Server 2013
Content transfer encoding defines encoding methods for transforming binary email message data into the US-ASCII plain text format. This transformation allows the message to travel through older SMTP messaging servers that only support messages in US-ASCII text. Content transfer encoding is defined in RFC 2045. The transfer encoding method is stored in the Content-Transfer-Encoding header field in the message. In Microsoft Exchange Server 2013, the following content transfer encoding methods are available:
- 7-bit: This value indicates that the message body data is already in the US ASCII plain text format, and no message encoding has been done to the message.
- Quoted-printable (QP): This encoding method uses printable US-ASCII characters to encode the message body data. If the original message text is mostly US-ASCII text, QP encoding gives somewhat readable and compact results. By default, Exchange 2013 uses QP for encoding binary message data.
- Base64: This encoding method is based primarily on the privacy-enhanced mail (PEM) standard defined in RFC 1421. Base64 encoding uses the 64-character alphabet encoding method and output padding characters defined by PEM to encode the message body data. Base64 encoding creates a predictable increase in message size and is optimal for binary data and non-US-ASCII text.
You configure the transfer encoding method using the ByteEncoderTypeFor7BitCharsets parameter on the Set-OrganizationConfig and Set-RemoteDomain cmdlets. The content transfer encoding settings you configure with Set-OrganizationConfig apply to all messages in the Exchange organization. The content transfer encoding settings you configure with Set-RemoteDomain apply only to message sent to external recipients in the remote domain.
The following table lists the values that you can use to set the transfer encoding method.
Parameter in Set-OrganizationConfig | Parameter in Set-RemoteDomain | Description |
---|---|---|
0 | Use7Bit | Always use 7-bit encoding for HTML and for plain text. This is the default value. |
1 English language course free download. | UseQP | Always use QP encoding for HTML and for plain text. |
2 | UseBase64 | Always use Base64 encoding for HTML and for plain text. |
5 | UseQPHtmlDetectTextPlain | Use QP encoding for HTML and for plain text unless line wrapping is enabled in plain text. If line wrapping is enabled, use 7-bit encoding for plain text. |
6 | UseBase64HtmlDetectTextPlain | Use Base64 encoding for HTML and for plain text, unless line wrapping is enabled in plain text. If line wrapping is enabled in plain text, use Base64 encoding for HTML, and use 7-bit encoding for plain text. |
13 | UseQPHtml7BitTextPlain | Always use QP encoding for HTML. Always use 7-bit encoding for plain text. |
14 | UseBase64Html7BitTextPlain | Always use Base64 encoding for HTML. Always use 7-bit encoding for plain text. |
For more details about Content-Transfer-Encoding header field, see the 'Understanding the structure of email messages' section in Content conversion.
For more information about remote domains, see Remote domains.
What do you need to know before you begin?
- Estimated time to complete: 15 minutes
- You need to be assigned permissions before you can perform this procedure or procedures. To see what permissions you need, see the 'Transport service' entry in the Mail flow permissions topic.
- For information about keyboard shortcuts that may apply to the procedures in this topic, see Keyboard shortcuts in the Exchange admin center.
Tip
Having problems? Ask for help in the Exchange forums. Visit the forums at Exchange Server.
Use the Shell to configure the content transfer encoding method for the organization
To configure the content transfer encoding method for the organization, run the following command:
For example, to set the content transfer encoding method to Base64, run the following command:
Use the Shell to configure the content transfer encoding method for a remote domain
To configure the content transfer encoding method for all the recipients in a remote domain, run the following command:
For example, to set the content transfer encoding method to Base64, run the following command:
How do you know this worked?
To verify that you have successfully configured the method for content transfer encoding, do the following:
- Send a test message that contains a mixture of US-ASCII text and binary data or non-US-ASCII text to an internal or external test account. Use an internal account to test organization settings, and an external account in the remote domain to test remote domain settings.
- In an email client, view the Content-Transfer-Encoding header field in the message, and verify the content transfer encoding method that was used on the message matches the method you configured.
Definition
Specifies the Content-Transfer-Encoding header information for an email message attachment.
ValueTypeValueTypeValueTypeValueType
TransferEncodingTransferEncodingTransferEncodingTransferEncodingFields
Base64Base64Base64Base64 | 1 | Encodes stream-based data. See RFC 2406 Section 6.8. |
EightBitEightBitEightBitEightBit | 3 | The data is in 8-bit characters that may represent international characters with a total line length of no longer than 1000 8-bit characters. For more information about this 8-bit MIME transport extension, see IETF RFC 6152. |
QuotedPrintableQuotedPrintableQuotedPrintableQuotedPrintable | 0 | Encodes data that consists of printable characters in the US-ASCII character set. See RFC 2406 Section 6.7. |
SevenBitSevenBitSevenBitSevenBit | 2 | Used for data that is not encoded. The data is in 7-bit US-ASCII characters with a total line length of no longer than 1000 characters. See RFC2406 Section 2.7. |
UnknownUnknownUnknownUnknown | -1 | Indicates that the transfer encoding is unknown. |
Base64 Encoding Java
Examples
The following code example displays TransferEncoding used by an attachment.
Remarks
The values in the TransferEncoding enumeration are used with the AttachmentBase.TransferEncoding property.
The Content-Transfer-Encoding header specifies the encoding of the associated message body so that it meets SMTP requirements. SMTP requires data for transport to be in 7-bit US-ASCII characters with lines no longer than 1000 characters.
Content-Transfer-Encoding values are described in detail in RFC 2045 Section 6, available at https://www.ietf.org.