Outlook iCal会议邀请说明问题

时间:2015-02-13 10:02:37

标签: email events outlook icalendar rfc5545

我正在使用iCal发送event php个邀请。一切都以正确的方式显示,并且RVSP按钮正确显示。但在description之后,cutting downfirst line。例如,如果我的描述是:

The problem occurs when I have multiple lines in the description. 
If it contains the text for example I will only get in my outlook calendar 
description. The part after disappears.

唯一的第一行显示如下:

The problem occurs when I have multiple lines in the description.

如果有人帮助我。 我已经包装了行但是在第一行之后它将不会显示。这是代码段。

function ical_split($preamble, $value) {
    $value = trim($value);
    $value = strip_tags($value);
    $value = preg_replace('/\n+/', ' ', $value);
    $value = preg_replace('/\s{2,}/', ' ', $value);
    $preamble_len = strlen($preamble);
    $lines = array();
    while (strlen($value)>(74-$preamble_len)) {
        $space = (74-$preamble_len);
        $mbcc = $space;
        while ($mbcc) {
            $line = mb_substr($value, 0, $mbcc);
            $oct = strlen($line);
            if ($oct > $space) {
                $mbcc -= $oct-$space;
            }
            else {
                $lines[] = $line;
                $preamble_len = 1; // Still take the tab into account
                $value = mb_substr($value, $mbcc);
                break;
            }
        }
    }
    if (!empty($value)) {
        $lines[] = $value;
    }
    return join($lines, "\\n\\t");
}

我把它称之为:

$meeting_notes="The problem occurs when I have multiple lines in the description. If it contains the text for example I will only get in my outlook calendar description. The part after disappears."
ical_split('DESCRIPTION:', $meeting_notes)

此处附带ics文件的详细信息。

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Microsoft Corporation//Outlook 11.0 MIMEDIR//EN
CALSCALE:GREGORIAN
METHOD:REQUEST
BEGIN:VEVENT
DTSTART:20150227T163000Z
DTEND:20150227T173000Z
DTSTAMP:20150211T094306Z
ORGANIZER;CN=Charlene Switzer:MAILTO:email_here
UID:40
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=name_here;X-NUM-GUESTS=0:MAILTO:email_here
DESCRIPTION:The problem occurs when I have multiple lines in the description. If it contains the text for example I will only get in my outlook calendar description. The part after disappears.
LOCATION:asdf asd
SEQUENCE:0
STATUS:CONFIRMED
TRANSP:OPAQUE
SUMMARY:Meeting
PRIORITY:5
CLASS:PUBLIC
BEGIN:VTIMEZONE
TZID:Eastern
END:VTIMEZONE
END:VEVENT
END:VCALENDAR

2 个答案:

答案 0 :(得分:2)

要花费德米特里的解释,你需要参考指定iCalendar格式的RFC5545

<强> 3.1. Content Lines

  

iCalendar对象被组织成单独的文本行,      称为内容行。内容行由换行符分隔,      这是一个CRLF序列(CR字符后跟LF字符)。

     

文本行不应超过75个八位字节,不包括行      打破。长内容行应该分成多行      使用线“折叠”技术的表示。那就是很久了      通过插入CRLF,可以在任意两个字符之间拆分行      紧接着是一个单一的线性空白字符(即      SPACE或HTAB)。

回到你的问题,就像德米特里建议你应该在你的CRLF之后添加TABSPACE,但你也要确保你的行不超过75字节。

答案 1 :(得分:0)

确保第二行以制表符(0x9)开头 - 这样就可以正确地解开这些行。