tags:

views:

1321

answers:

3

Can an iCal attachment contain HTML in the description property? If so, what are the restrictions?

A: 

I think it's possible, according to the RFC, but I doubt that it's a good idea, as it appears to be a bit of a security hole.

McWafflestix
A: 

HTML in the description won't be rendered as HTML in Outlook, at the least. If you want to include rich text that Outlook will recognize, export an event from your Outlook calendar, and take a look at what they do. I believe they provide plain-text in the Description and then create another property for the HTML.

bdukes
Thanks. Started w/ the Outlook generated iCal file and was able to find the appropriate fields and test w/ a few other clients.
catalpa
+6  A: 

After doing some research and testing. The answer is a qualified no. Meaning: you could throw it in there, but you shouldn't.

It is not strictly forbidden by the RFC, but DESCRIPTION is not the appropriate property for HTML content.

DESCRIPTION should be the plain text version of your content. The property X-ALT-DESC with a FMTTYPE declaration of text/html is the appropriate property for HTML content.

The following example worked in both Outlook and Gmail/Google Calendar, but does not appear to be supported by Thunderbird(w/Lightning): (please, forgive the ouput. it was generated by Outlook)

X-ALT-DESC;FMTTYPE=text/html:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//E
    N">\n<HTML>\n<HEAD>\n<META NAME="Generator" CONTENT="MS Exchange Server ve
    rsion 08.00.0681.000">\n<TITLE></TITLE>\n</HEAD>\n<BODY>\n<!-- Converted f
    rom text/rtf format -->\n\n<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG
    ="en-us"><FONT FACE="Calibri">Is this in HTML?</FONT></SPAN><SPAN LANG="en
    -us"></SPAN><SPAN LANG="en-us"></SPAN></P>\n\n<P DIR=LTR><SPAN LANG="en-us
    "><FONT FACE="Calibri">Bullets:</FONT></SPAN></P>\n\n<P DIR=LTR><SPAN LANG
    ="en-us"><FONT FACE="Calibri">1.&nbsp\;&nbsp\;&nbsp\;&nbsp\;&nbsp\;</FONT>
    </SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-
    us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT FACE="Calib
    ri">Test 1</FONT></SPAN></P>\n\n<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="
    Calibri">2.&nbsp\;&nbsp\;&nbsp\;&nbsp\;&nbsp\;</FONT></SPAN><SPAN LANG="en
    -us"> <FONT FACE="Calibri">Test 2</FONT></SPAN><SPAN LANG="en-us"></SPAN><
    SPAN LANG="en-us"></SPAN></P>\n\n<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPA
    N LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN></P>\n\n</BODY>\n</HTML>

Like any HTML rendering in an email client supported tags and styles are limited.

catalpa