Mail content typesFrom MozillaZine Knowledge Base
This article describes the types of e-mail message that you can work with in Thunderbird: HTML and plain text. Technically, HTML and plain text are different content types, but Thunderbird's user interface refers to them as the "format" of the message. Your choices in Thunderbird for writing messages, sending messages, and displaying messages are all slightly different. Note: For information about content types of attachments, see: Actions for attachment file types
[edit] Comparing HTML and plain textHTML supports font and color changes, graphical formatting of lists and tables, and other visual effects in the way that you see on web pages. It makes messages easier to read by allowing you to use proportional fonts in a clear layout. Plain text does not support font or color changes. You can only format lists and tables by careful spacing, and the spacing only works well if you use a monospaced font. This tends to make messages more difficult to read. Thunderbird normally uses an advanced form of plain text that supports flowed paragraphs and certain other HTML-like features. (In a flowed paragraph, the lines automaticlly break at the edge of the window or pane, so that you never have to scroll sideways to see the ends of lines.) [edit] Writing messagesWhen you write a message in Thunderbird, you use either an HTML editor or a plain text editor. If you use an HTML editor, then you can send the message in HTML, plain text, or both. If you use a plain text editor, then you can only send the message in plain text. You usually specify which type of editor to use by identity. In your account settings, on the Composition & Addressing page, either check or clear the checkbox: "Compose messages in HTML format" This setting is for the account's default identity. To change the setting for the account's other identities, press the account's Manage Identities... button and edit each identity. Thunderbird uses the setting for the message's initial identity. If you change the message's identity (by choosing a different From address), Thunderbird does not change the editor. For more information about identities and their settings, see: Mail concepts You can tell which type of editor you are using by looking at the menu bar. If it has a Format menu, then you are using an HTML editor. If not, then you are using a plain text editor. Confusingly, you can switch the HTML editor to plain text mode and back, but if you start with the plain text editor you cannot switch it to HTML. [edit] Changing the type for a one-off messageFor a one-off message, you can change the type you selected in your account settings. Hold down the Shift key while you press a toolbar button to write the message. The toolbar button might be Write, Reply, Reply to All, or Forward. If you specified HTML in your account settings, Thunderbird writes this one message as plain text. If you specified plain text, Thunderbird writes this one message as HTML. Notes
[edit] Enhanced HTML featuresWhen you use the HTML editor, you can use all the basic features of HTML. Thunderbird provides some enhancements that go beyond these basic features. These enhancements are built from standard HTML tags, so if recipients of your message can view standard HTML, they can see these enhancements in your message:
If you know the HTML language, you can extend the basic features by typing HTML tags—choose: Insert – HTML... To edit existing tags in the message, first select the part you want to edit (or the whole message), then choose: Insert – HTML... For more information, see: Edit HTML source [edit] Enhanced plain text featuresThunderbird and some other e-mail clients support enhanced plain text features:
[edit] Sending messagesIf you compose a message as plain text, then you can only send it as plain text. If you compose a message as HTML, then you can send it as plain text, HTML, or both. However, Thunderbird normally makes the choice of type for you automatically, depending on the recipients of the message or their domains. This corresponds to the default menu choice (in the Compose window) Options – Format – Auto-Detect. The Mail Tweak extension has a Force HTML tweak that can change the default. To specify the content type for the message you are writing, in the Compose window choose Options – Format – and then the content type. If you send both plain text and HTML, Thunderbird combines both content types into one message. Technically, it is known as a multipart message. Each recipient's mail client chooses which to display, depending on its capabilities and the recipient's preferences. [edit] Plain text by defaultIf your message does not use any HTML features (bold, underline, italics, colors, etc.), and if Thunderbird has no information about the recipients' preferences, then it sends plain text by default. To send HTML by default, use a signature that includes some HTML feature. Even something invisible like an italic space is enough to make the content type HTML: <i> </i> [edit] Auto-detect by recipientTo specify the content type for a recipient, create or edit the recipient's card in your address book. On the Contact page, in the Internet group, set: "Prefers to receive messages formatted as" [edit] Auto-detect by domainA domain is the part of an e-mail address following the @ sign. For example, someone whose e-mail address is someone@example.com is in the domain: example.com To specify the content type for a domain, choose Options (Preferences) – Composition – General – Send Options... [edit] Auto-detect conflictsIf you try to send an HTML message, but auto-detect finds a recipient who prefers plain text, Thunderbird does one of four things:
To configure this, choose Options (Preferences) – Composition – General – Send Options... If you try to send a plain text message, but auto-detect finds a recipient who prefers HTML, then Thunderbird sends plain text anyway. All recipients can read plain text, even if they prefer HTML. [edit] Disabling paragraph flowTo disable paragraph flow when you send plain text messages, and in the plain text part of multipart messages, set the preference:
Note: Disabling paragraph flow can make your messages difficult for other people to read. They might see line breaks in strange places. If you have quoted another message, the quote might not be displayed in the normal way. [edit] Reading messagesWhen you read a plain text message, you can only read it as plain text. However, various settings control the ways in which Thunderbird enhances plain text messages. When you read an HTML message, you can read it as the original HTML, as simple HTML, or as plain text. To specify, choose: View – Message Body As [edit] Original HTMLIf you choose View – Message Body As – Original HTML, then you see HTML messages in their original form, except that:
For privacy settings, choose: Options (Preferences) – Privacy – General Note: There are normally no security issues when you read a message in Thunderbird. It is not normally possible for hostile code to attack your computer just because you read a message. But if you open an attachment, then Thunderbird passes the attachment to your operating system or to some other application. Your operating system or the other application might allow the attachment to attack your computer. [edit] Simple HTMLIf you choose View – Message Body As – Simple HTML, then you see HTML messages in a simplified form. Thunderbird does not run JavaScript code, and does not download remote images. Simple HTML preserves basic HTML formatting. [edit] Plain textIf the message is plain text, then you always see plain text. If you choose View – Message Body As – Plain Text, then you see plain text even if the message is really HTML. If the message is multipart, then you see the plain text part. Otherwise Thunderbird converts the HTML message to plain text. Thunderbird normally enhances plain text by supporting certain HTML-like features:
The supported smileys are:
Optionally, you can turn off Thunderbird's plain text enhancements:
.moz-txt-star {font-weight: normal;} .moz-txt-underscore {text-decoration: none !important;} .moz-txt-slash {font-style: normal;}
.moz-text-flowed :link, .moz-text-plain :link { color: inherit !important; text-decoration: inherit !important; cursor: inherit !important; }
and add this rule to your userContent.css file: .moz-text-plain blockquote[type=cite] {border: none !important; padding: 0 !important;}
.moz-txt-sig {color: inherit !important;} [edit] AdvancedThis section mentions some features for advanced users, or for troubleshooting. [edit] Message sourceTo see the encoded data in a message, select the message in a folder and choose View – Message Source... You can look at the message source to check all of a message's headers, including its content type. For example, if the message is plain text, then you see a line like: Content-Type: text/plain; charset=ISO-8859-15; format=flowed If the message is HTML, then you see a line like: Content-Type: text/html; charset=ISO-8859-15 If the message is multipart, then you see a line like: Content-Type: multipart/alternative; and below that line you see the separate plain text and HTML parts with their own Content-Type headers. Parts of the encoded data might look similar to the actual message, but it is not intended to be exactly the same. You cannot work with the encoded data directly in Thunderbird. To understand the encoding, see the RFCs linked below. [edit] Charset (character encoding)The message charset is known in Thunderbird as the character encoding. When you write a message in Thunderbird, you are writing in Unicode. The charset is only applied when you send a message or save it as a draft. When you send an HTML message, Thunderbird uses HTML to encode any characters in the message that are not supported by the charset. This means that the charset does not matter much, because HTML supports Unicode. When you send a plain text or multipart message, Thunderbird normally uses your default charset to encode the message. To set the default charset for sending messages, choose Options (Preferences) – Display – Fonts. (Yes, Display – Fonts, not Composition!) Notes:
To specify a different charset for sending a particular message, in the Compose window choose Options – Character Encoding. If you send a plain text message containing characters that are not supported in the charset, then Thunderbird might quietly send the message in a different charset, or it might warn you and invite you to use UTF-8. If you send a multipart message containing characters that are not supported in the charset, then Thunderbird replaces (transliterates) those characters in the plain text part. In some cases Thunderbird uses meaningful replacements, like EUR for €. In other cases it uses question marks. [edit] Plain text transliterationWhen Thunderbird generates multipart plain text in a charset that does not support all the characters in the message, it transliterates certain characters. For example, if the euro currency symbol € is not supported, Thunderbird replaces it with EUR. To customize this conversion, go to Thunderbird's installation directory, then to the res/entityTables directory there. Under Mac OS X you find the wanted directory only within the application itself. An easy technique to access it is to use the Finder's menu command "Go -> Go to Folder..." and enter /Applications/Thunderbird.app/Contents/MacOS/res/entityTables. Alternatively Control-click the application and choose from the pop-up menu the command "Show Package Contents" and then go to Contents/MacOS/res/entityTables directory there. Edit the file: transliterate.properties. [edit] ASCIIASCII is a limited charset properly known as US-ASCII. There is rarely any need to use it, because other charsets support all its characters. To enable US-ASCII for sending messages, set the preference:
To enable ASCII as an equivalent to US-ASCII for displaying messages, go to Thunderbird's installation directory, then to the res directory there. Edit the file charsetalias.properties and add the entry: ascii=us-ascii [edit] Color of quoted text in plain-text repliesTo change the default display color for quoted text in plain-text replies, add the following to your userContent.css file: /* Quoted text in plain-text replies */ span[_moz_quote=true] {color: green;} Replace "green" with whatever color you want to use. [edit] See also[edit] External linksInternet standards:
Wikipedia: |