我必须从经典的ASP应用程序发送日历邀请才能收到Outlook。使用各种不同的电子邮件组件(ASPEmail,ASPMail,JMail)我已经发送了带附件的邮件,但是当收到它们时,Outlook不会将附件识别为日历邀请,而GMail会这样做。
在JMail中,我可以将附件的内容类型设置为文本/日历,但这没有区别。
邀请已经过测试here,并且验证正常。
我对此问题的任何解决方案持开放态度,包括将邀请作为内联工作,但遗憾的是.NET和PHP不是选项。
这是一些测试代码 - JMail是我能找到的唯一可以设置附件内容类型的组件。
set msg = Server.CreateOBject( "JMail.Message" )
set attachment = Server.CreateOBject( "JMail.Attachment" )
msg.Logging = true
msg.silent = true
msg.From = "website@userdomain.com"
msg.FromName = "Website"
msg.AddRecipient "outlook@userdomain.com", "Outlook"
msg.Subject = "Meeting"
msg.Body = "Meeting invite attached"
'although cid not needed, i could only get this to work by using cid =
cid = msg.AddAttachment (server.mappath(".\invite.ics"), false, "text/calendar")
msg.ContentType = "text/calendar"
if not msg.Send("mail.userdomain.com" ) then
Response.write "<pre>" & msg.log & "</pre>"
else
Response.write "Message sent succesfully!"
end if
将消息内容类型设置为文本/日历后,单击附件时,它现在显示为十六进制而不是简单的文本文件。它仍未被视为邀请。这是它的顶部:
This is a multipart message in MIME format.
----NEXT_BM_D29EC5CD87384387A59E240A29CD74DD
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: Quoted-Printable
Meeting invite attached
----NEXT_BM_D29EC5CD87384387A59E240A29CD74DD
Content-Type: text/calendar; name="=?iso-8859-1?Q?invite=2Eics?="
Content-Transfer-Encoding: base64
Content-Description: =?iso-8859-1?Q?invite=2Eics?=
Content-Disposition: attachment; filename="=?iso-8859-1?Q?invite=2Eics?="
Content-ID: <8AB4D71598B445B88353F487644AC2F3>
顺便说一下,我正在使用Office Professional Plus 2013的测试版本。
在GMail上收到的类似消息显示了这些标题:
Content-Type: text/calendar;
boundary="--NEXT_BM_675B64750B5649EAAF1A3F3D9EC69302"
Return-path: <website@userdomain.com>
This is a multipart message in MIME format.
----NEXT_BM_675B64750B5649EAAF1A3F3D9EC69302
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: Quoted-Printable
Meeting invite attached
----NEXT_BM_675B64750B5649EAAF1A3F3D9EC69302
Content-Type: text/calendar; name="=?iso-8859-1?Q?invite=2Eics?="
Content-Transfer-Encoding: base64
Content-Description: =?iso-8859-1?Q?invite=2Eics?=
Content-Disposition: attachment; filename="=?iso-8859-1?Q?invite=2Eics?="
Content-ID: <C6C87170FE7B4BC581E7EE33EE24BC71>
因此,消息类型确实设置为文本/日历,但消息的文本部分设置为text-plain。
使用修改后的代码版本,将正文设置为实际的iCal数据,并使用内容类型的文本/日历,Outlook仍然无法将其识别为邀请,但会将正文转换为附件消息主题为文件名,例如test.ics
答案 0 :(得分:2)
由于客户端要求快速找到解决方案的压力,我选择使用旧的vCalendar版本1规范,并使用.vcs文件而不是.ics执行此操作。
在测试中,Outlook已经证明很高兴将文本.vcs附件识别为日历条目,而不需要特殊的内容类型等。这种格式虽然很旧,但具有我们客户需要的所有功能。
vCalendar版本1.0(.vcs)的完整规格可在http://www.imc.org/pdi/pdiproddev.html
找到答案 1 :(得分:0)
确保邮件内容类型是日历,而不仅仅是附件。 如果邀请需要包含附件,则需要将它们嵌入到iCal部件中,而不是作为单独的附件添加。