0

使用sabre/vobject库,我正在创建一个像这样的 ics 文件:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Sabre//Sabre VObject 4.1.2//EN
CALSCALE:GREGORIAN
BEGIN:VEVENT
UID:sabre-vobject-d4b1ccb3-2197-4ee4-aab8-7bc2516adbf8
DTSTAMP:20170123T182612Z
SUMMARY:testev2
DESCRIPTION:
DTSTART;TZID=Europe/Athens:20170214T090000
DTEND;TZID=Europe/Athens:20170215T170000
LOCATION:
ORGANIZER;CN=Organizer Name:mailto:organizer@example.com
ATTENDEE;CN=Test User:MAILTO:test.user@somewhere.com
END:VEVENT
END:VCALENDAR

然后使用phpmailer,我将生成的文件附加到电子邮件中,并将其发送给参与活动的用户。使用 Thunderbird(带有 Lightning 扩展程序 - 默认情况下处于打开状态)的用户会收到以下格式的电子邮件:

在此处输入图像描述

正如您在图片中看到的,ics 文件被解析并呈现在电子邮件底部的表格中。但是表头(以红色标记的)没有显示正确的信息。测试用户从未确认过他/她的存在,如果他/她确认过,ics 文件不会提供任何有关它的信息。

我的ics文件格式错误吗?

它是雷鸟/闪电的已知错误吗?

更新 邮件的电子邮件标题:

Return-Path: <XXXXXXXXXXXXXXXX>
Received: from deliver ([unix socket])
     by mail (Cyrus v2.3.16-Fedora-RPM-2.3.16-13.el6_6) with LMTPA;
     Tue, 24 Jan 2017 12:48:10 +0200
X-Sieve: CMU Sieve 2.3
Received: from [XXX.XXX.XXX.XXX] (XXXXXXXXXXXXXX [XXX.XXX.XXX.XXX
    (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits))
    (No client certificate requested)
    by XXXXXXXXXXXXXX (Postfix) with ESMTPSA id 6F18C1BE0305
    for <XXXXXXXXXXXXXX>; Tue, 24 Jan 2017 12:48:10 +0200 (EET)
Subject: Fwd: Event invitation: testev2
To: "XXXXXXXX" <XXXXXXXXXXXXXX>
From: XXXXXXXXXXXXXX <XXXXXXXXXXXXXX>
X-Forwarded-Message-Id:
Message-ID: <bac7749e-9699-1b50-9de5-27a510c663a4@XXXXXXXX>
Date: Tue, 24 Jan 2017 12:48:09 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.6.0
MIME-Version: 1.0
Content-Type: multipart/mixed;
 boundary="------------79DD2A1D49F1A57579125B45"

This is a multi-part message in MIME format.
--------------79DD2A1D49F1A57579125B45
Content-Type: multipart/alternative;
 boundary="------------72E56459CD6D794D0DF5AC4B"

--------------72E56459CD6D794D0DF5AC4B
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 8bit
> ------- Forwarded Message --------
Forward message content
> --------------72E56459CD6D794D0DF5AC4B
> Content-Type: text/html; charset=windows-1252
> Content-Transfer-Encoding: 8bit
>
HTML Content
> --------------72E56459CD6D794D0DF5AC4B--
>
> --------------79DD2A1D49F1A57579125B45
> Content-Type: text/calendar;
>  name="invitation.ics"
> Content-Transfer-Encoding: 7bit
> Content-Disposition: attachment;
>  filename="invitation.ics"
>
ICS Content
> --------------79DD2A1D49F1A57579125B45--
4

1 回答 1

0

您应该使 ics 附件的 Content-Type 类似于:

Content-Type: text/calendar; charset="utf-8"; method=REQUEST

method选项是神奇的词。我不完全确定这是否有效,但至少更接近规范。如果它不起作用,我很乐意更新我的答案。

于 2017-01-25T13:35:52.547 回答