几天来,我一直在尝试通过 smtp 发送 iCalendar 邀请。我正在使用 DDay.iCal 库来构建消息的 iCalendar 组件,并且我正在使用或多或少的本土 smtp 服务器来发送消息(不幸的是,我暂时坚持使用此解决方案)。
我已经搞砸了几种不同的方法,但我没有任何运气。结果通常是收件人收到一封带有 .ics 附件的电子邮件。在 Outlook 中,我可以打开附件并将其添加到我的日历中;gmail 只会让我下载附件。它不会将其识别为日历邀请。
下面是我尝试过的一种场景的示例。有人可以告诉我它有什么问题或需要做什么来构建正确的日历邀请消息吗?
谢谢!
Delivered-To: jordan_test@gmail.com
Received: by 10.68.224.234 with SMTP id rf10csp257513pbc;
Mon, 27 Aug 2012 09:16:44 -0700 (PDT)
Received: by 10.50.85.228 with SMTP id k4mr10905189igz.22.1346084204116;
Mon, 27 Aug 2012 09:16:44 -0700 (PDT)
Return-Path: <283877=jordan_test=gmail.com@smtp.mycompany.com>
Received: from smtp.mycompany.com ([214.16.251.150])
by mx.google.com with SMTP id cw2si32587704icc.106.2012.08.27.09.16.43;
Mon, 27 Aug 2012 09:16:44 -0700 (PDT)
Received-SPF: neutral (google.com: 214.16.251.150 is neither permitted nor denied by domain of 283877=jordan_test=gmail.com@smtp.mycompany.com) client-ip=215.16.251.150;
Authentication-Results: mx.google.com; spf=neutral (google.com: 215.16.251.150 is neither permitted nor denied by domain of 283877=jordan_test=gmail.com@smtp.mycompany.com) smtp.mail=283877=jordan_test=gmail.com@smtp.mycompany.com
Date: Mon, 27 Aug 2012 16:16:43 GMT
X-Mailer: BlahCommunicationsServices 1.0.0, by BLAH Inc.
Subject: =?UTF-8?B?SGV5ISB0aGlzIGlzIGZvciB5b3Uu?=
From: <ical@return.mycompany.com>
To: <jordan_test@gmail.com>
Reply-To: <ical@return.mycompany.com>
MIME-Version: 1.0
X-Priority: 3 (Normal)
Content-Type: multipart/alternative;boundary="__=_Part_Boundary_1687780707_370337274"
Message-Id: <283877@smtp.mycompany.com>
References: <283877@smtp.mycompany.com>
--__=_Part_Boundary_1687780707_370337274
Content-Transfer-Encoding: 7bit
Content-Type: text/plain
test test test
--__=_Part_Boundary_1687780707_370337274
Content-Transfer-Encoding: 7bit
Content-Type: text/calendar;method=REQUEST;charset=utf-8
BEGIN:VCALENDAR
VERSION:2.0
METHOD:PUBLISH
PRODID:-//ddaysoftware.com//NONSGML DDay.iCal 1.0//EN
BEGIN:VEVENT
ATTENDEE;CN=Jordan;ROLE=REQ-PARTICIPANT;PARTSTAT=TENTATIVE;CUTYPE=INDIVIDUAL;RSVP=TRUE:MAILTO:jordan@mycompany.com
ATTENDEE;CN=Jordan;ROLE=REQ-PARTICIPANT;PARTSTAT=TENTATIVE;CUTYPE=INDIVIDUAL;RSVP=TRUE:MAILTO:jordan_test@gmail.com
DESCRIPTION:test test test
DTEND:20120828T130000
DTSTAMP:20120827T121642
DTSTART:20120828T120000
ORGANIZER:MAILTO:ical@return.mycompany.com
SEQUENCE:0
SUMMARY:Hey! this is for you.
UID:234434
END:VEVENT
BEGIN:VTIMEZONE
END:VTIMEZONE
END:VCALENDAR
--__=_Part_Boundary_1687780707_370337274--