Using X-ALT-DESC / Applying HTML to calendar invites in Outlook
For those in the future:
The problem was the use of
.AppendLine
.
Simply use
.Append
I found that the HTML string must be all on one line. If the HTML is broken over multiple lines, that does not conform to Vcalendar encoding and the description is either rendered as a blank page or as plain text with all HTML tags visible.
I've seen others out there claiming that the DESCRIPTION tag must be used in front of "X-ALT-DESC;FMTTYPE=text/html:". This is totally WRONG and FALSE. If "DESCRIPTION" exists, it takes precedence, the "X-ALT-DESC;FMTTYPE=text/html:" line is completely ignored by Outlook and the plain text description is rendered. Therefore, "X-ALT-DESC;FMTTYPE=text/html:" must stand on it's own and be on it's own line.
Working example:
... X-ALT-DESC;FMTTYPE=text/html:<html><body><a href="http://bing.com">Bing</a></body></html> ...
Wrong:
... DESCRIPTION;X-ALT-DESC;FMTTYPE=text/html:<html><body><a href="http://bing.com">Bing</a></body></html> ...
Wrong again:
... X-ALT-DESC;FMTTYPE=text/html:<html> <body> <a href="http://bing.com">Bing</a> </body> </html> ...
You can have X-ALT-DESC on multiple lines, you just need to add a space on the beginning of each lines following it.
Lines of text SHOULD NOT be longer than 75 octets, excluding the line break. Long content lines SHOULD be split into a multiple line representations using a line "folding" technique. That is, a long line can be split between any two characters by inserting a CRLF immediately followed by a single linear white-space character (i.e., SPACE or HTAB). Any sequence of CRLF followed immediately by a single linear white-space character is ignored (i.e., removed) when processing the content type.
https://icalendar.org/iCalendar-RFC-5545/3-1-content-lines.html