【问题标题】:Icalendar .ics not showing issue after adding html content添加 html 内容后,Icalendar .ics 未显示问题
【发布时间】:2015-09-14 19:05:00
【问题描述】:

我遇到了 icalendar 的这个问题,它在发送到 gmail、yahoo、aoutlook.com 时不显示附件和确认按钮。 它以前在没有 html 消息和 multipart/mixed 标头的情况下工作。 现在,当我收到电子邮件时,它只向我显示日历的文本,它无法识别它。 内容类型:多部分/混合;边界="982f8d486c3cbed0e28b314e7a433c3d"

--982f8d486c3cbed0e28b314e7a433c3d
Content-Type: multipart/alternative; boundary="19f4b0e33c6f735ae6f858b1df7b72f2"

--19f4b0e33c6f735ae6f858b1df7b72f2
Content-Type: text/calendar; method=REQUEST; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Testa//Tes//EN
METHOD:REQUEST
BEGIN:VEVENT
UID:20150914T205515-998107994-domain.com
DTSTAMP:20150914T205515
DTSTART:20150915T195500Z
DTEND:20150915T195500Z
ORGANIZER;CN=soy:MAILTO:admin@adminm.org
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=xxx.yyy@gmail.com:MAILTO:xxx.yyy@gmail.com
LOCATION:hj
SUMMARY:Rendez-vous 
BEGIN:VALARM
TRIGGER:-PT15M
ACTION:DISPLAY
DESCRIPTION:Reminder
END:VALARM
END:VEVENT
END:VCALENDAR

--19f4b0e33c6f735ae6f858b1df7b72f2--
--982f8d486c3cbed0e28b314e7a433c3d
Content-Type: application/ics; name="Rv-invite.ics"
Content-Disposition: attachment; filename="Rv-invite.ics"
Content-Transfer-Encoding: base64
X-Mailer: Microsoft Office Outlook 12.0
X-Mailer: CakePHP Email
Date: Mon, 14 Sep 2015 20:55:16 +0200
Message-ID: <55f71814db484f8fa8923d8664ca69fc@localhost>
Subject: Rendez-vous 
MIME-Version: 1.0
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
        <title>Emails/html</title>
</head>
<body>

<p>Dear,</p>

<p>Mr xxx sent an appointment</p>
</body>
</html>

提前致谢。

【问题讨论】:

  • 你应该总是提到你正在使用的确切的 cakephp 版本。我用的是 Cake2.7,它工作得很好。
  • 是否显示带有确认按钮的日历?

标签: cakephp icalendar cakeemail


【解决方案1】:

你的第二个正文部分有 2 个内容类型的标题:

Content-Type: application/ics; name="Rv-invite.ics"
Content-Disposition: attachment; filename="Rv-invite.ics"
Content-Transfer-Encoding: base64

Content-Type: text/html; charset=UTF-8
 Content-Transfer-Encoding: 8bit

看起来有些标题也属于顶层而不是正文部分:

X-Mailer: Microsoft Office Outlook 12.0
X-Mailer: CakePHP Email
Date: Mon, 14 Sep 2015 20:55:16 +0200
Message-ID: <55f71814db484f8fa8923d8664ca69fc@localhost>
Subject: Rendez-vous 
MIME-Version: 1.0

另请参阅这篇文章,了解一般使用的正确 MIME 结构:Multipart email with text and calendar: Outlook doesn't recognize ics

【讨论】:

    猜你喜欢
    • 2015-05-20
    • 1970-01-01
    • 2020-04-23
    • 2013-01-09
    • 1970-01-01
    • 2016-09-20
    • 2014-08-04
    • 1970-01-01
    • 2023-04-02
    相关资源
    最近更新 更多