简体   繁体   English

IBM(Lotus)Notes无法识别iCal(.ics)文件

[英]iCal (.ics) file not recognized by IBM (Lotus) Notes

I'm generating ICS files from a PHP application and emailing them as attachments (via SendGrid api). 我正在从PHP应用程序生成ICS文件并通过电子邮件将其作为附件发送(通过SendGrid api)。

The ICS file works fine with Gmail web mail, and with an iPhone. ICS文件可以与Gmail网络邮件和iPhone一起使用。 However, IBM Notes does not recognize them as meeting invites. 但是,IBM Notes不会将它们识别为会议邀请。 Notes shows the attachment but does not see it as an event invite. Notes显示附件,但不将其视为事件邀请。

Here's my ICS file: 这是我的ICS文件:

BEGIN:VCALENDAR
PRODID:-//My Company//v1.1//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:REQUEST
BEGIN:VEVENT
DTSTART:20160127T140000Z
DTEND:20160127T143000Z
DTSTAMP:20160114T213657Z
ORGANIZER;CN=Demo Two:
 mailto:demo2@example.com
UID:e93838a737b3f9ae75056968b22281b2
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=CHAIR;RSVP=FALSE
 ;CN=Demo Two:mailto:demo2@example.com
CREATED:20160114T213657Z
DESCRIPTION:another scheduled
LAST-MODIFIED:20160114T213657Z
LOCATION:See email
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:another scheduled
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR

I'm trying to send the same ICS file to multiple recipients, so I don't include an ATTENDEE line for the recipient, only for the CHAIR. 我正在尝试将相同的ICS文件发送给多个收件人,因此我不会为收件人包含ATTENDEE行,仅适用于CHAIR。

I can't find ANY detailed information about what Notes requires in its ICS files... 我无法在其ICS文件中找到有关Notes所需内容的任何详细信息......

Any ideas what's going wrong? 有什么想法会出错吗?

I have diagnosed part of my problem by comparing the mail body with a Google Mail invite (which does work in Notes). 我通过将邮件正文与Google Mail邀请(在Notes中有效)进行比较来诊断出部分问题。 There are a couple obvious problems when attaching an icalendar ics file via SendGrid web api. 通过SendGrid web api附加icalendar ics文件时有几个明显的问题。

The mail needs to include several parts: a body, an inline text/calendar object, and an attached .ics file. 邮件需要包含几个部分:正文,内联文本/日历对象和附加的.ics文件。

Outlook and Google user the attached file. Outlook和Google用户附加的文件。 I think Notes uses the inline data, since it seems to ignore the .ics attachment. 我认为Notes使用内联数据,因为它似乎忽略了.ics附件。

I found this related StackOverflow question: How to add headers in sendgrid? 我发现这个相关的StackOverflow问题: 如何在sendgrid中添加标题?

So I have gone the route of building the message in SwiftMailer, with appropriate message and attachment headers. 所以我已经走了在SwiftMailer中构建消息的路径,带有适当的消息和附件头。 It seems to be working properly so far, but I'll confirm when I've tested in Notes. 到目前为止它似乎工作正常,但我会确认我在Notes中测试的时间。

EDIT: I have confirmed that making the icalendar invite inline does work, and that this invite now appears in Notes. 编辑:我已经确认使icalendar邀请内联确实有效,并且此邀请现在出现在Notes中。

Each section of the mail needs to have its own MIME type. 邮件的每个部分都需要有自己的MIME类型。 Here's the message body: 这是消息体:

Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<p>Hello,</p>
<p>This is a friendly reminder ...

And here's the icalendar invite (note you can't read the iCalendar data because it's base64 encoded: 这是icalendar邀请(请注意,您无法读取iCalendar数据,因为它是base64编码的:

Content-Type: text/calendar; charset=UTF-8; method=PUBLISH; name=invite.ics
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename=invite.ics

QkVHSU46VkNBTEVOREFSDQpQUk9ESUQ6LS8vU3RyaWRlLlRyYWluaW5nLy92
MS4xLy9FTg0KVkVSU0lPTjoyLjANCkNBTFNDQUxFOkdSRUdPUklBTg0KTUVU...

I got this output by adding the attachment in SwiftMailer like this: 我通过在SwiftMailer中添加附件来获得此输出,如下所示:

$attachment = Swift_Attachment::newInstance($ical, 'invite.ics', 'text/calendar');
$attachment->setDisposition('inline');
$attachment->setContentType('text/calendar; charset=UTF-8; method=PUBLISH');
$message->attach ( $attachment );

In the above snippet, $ical is a correctly-formatted iCalendar string. 在上面的代码片段中,$ ical是一个格式正确的iCalendar字符串。

Sorry this has gotten long, but info on how to do this properly is pretty hard to find. 对不起,这已经很久了,但有关如何正确执行此操作的信息很难找到。

It can be one of two problems: 它可能是两个问题之一:

First of all, you should have an attendee at least for the user to whom you are sending the invitation. 首先,您应该至少为要向其发送邀请的用户有一位与会者。

If that does not work, the MIME structure of your email may not be recognized by Lotus Notes, in which case you probably want to include the whole MIME message in your question. 如果这不起作用,Lotus Notes可能无法识别您的电子邮件的MIME结构,在这种情况下,您可能希望在您的问题中包含整个MIME消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM