eMail - alternative to text/plain and text/html

2.3k views Asked by At

I am looking for a way to send a preformatted email template (bold and coloured fonts). I don't want to use html (because the template is generated automatically and html looks pretty crappy). So I generated the template as rtf and tried to embed it into the email via

Content-Type: text/rtf
Content-Disposition: inline

Content-Type: text/richtext
Content-Disposition: inline  

but that lead to the rtf code being shown as normal text or attached to the mail.

1

There are 1 answers

0
Cascade On BEST ANSWER

RTF MIME type

For an RTF template, the matching MIME type is text/rtf or application/rtf (rather than image/rtf).
http://en.wikipedia.org/wiki/Rich_Text_Format

Side note: MIME types ending '/rtf' and '/richtext' are for two different unrelated formats. In the RTF article linked above, Wikipedia mentions that Rich Text is the predecessor of a format called Enriched Text - but neither are related to the RTF specification.

Worth a try...

You mentioned that email clients display RTF as an attachment, or raw text - which indicates RTF is not supported, but if you use Outlook it might be worth changing your Content-Type to text/rtf just to see whether that triggers RTF display in your mail client.

Microsoft Outlook supports RTF, but it converts RTF to HTML automatically whenever an email is sent to a recipient outside the organisation - and Microsoft recommend the default HTML format instead: http://office.microsoft.com/en-us/outlook-help/change-the-message-format-to-html-rich-text-or-plain-text-HP001232996.aspx

If your templates are only for internal use within an organisation using Outlook exclusively, you might be OK with RTF, but otherwise RTF is not generally supported in email.

HTML

Although you don't really want to use HTML, this is the format that email clients tend to support, especially webmail clients, since they get HTML rendering support for free courtesy of the web browser. If you decide to go the HTML route, note that email clients don't support the entire HTML specification - simple text formatting such as bold and coloured fonts is fine though.