在 python 中创建 ICS 文件作为纯文本电子邮件发送给外部客户端
Creating an ICS file in python sends as a plain text email to external clients
我正在创建一个 ICS 以附加到带有 python 中的 SMTPLib 和电子邮件库的电子邮件。当我发送会议请求时,它显示为会议请求通常应该在我们的组织内部。当我将会议请求发送给组织外部的人时,它向这些人显示的只是一封纯文本电子邮件,没有接受、拒绝等选项。
下面粘贴的是收到的电子邮件 headers 的输出,其中包括 icalendar 格式。我发现的许多可能的解决方案都是用户端的错误,但是当我发送在 outlook 中创建的会议请求并将其发送到外部电子邮件地址时,它会正常工作。
我的 icalendar 格式不正确吗?
Content-Type: multipart/mixed; boundary
MIME-Version: 1.0
Reply-To: test@test.com
Date: Fri, 15 Jun 2018 10:55:17 -0400
Subject: test
From: test <SchedulerApp@test.com>
To: test@test.com,another.test@gmail.com
Content-Type: multipart/alternative; boundary="
MIME-Version: 1.0
Content-Type: text/html; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
<h1>Test Email Body</h1>
MIME-Version: 1.0
Content-Type: text/calendar; method="PUBLISH"; charset="us-ascii"
Content-Transfer-Encoding: 7bit
BEGIN:VCALENDAR
PRODID://SchedulerApp//test company//en
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:REQUEST
BEGIN:VEVENT
DTSTART:20180616T074500
DTEND:20180616T084500
DTSTAMP:20180615T105517Z
ORGANIZER;CN=SchedulerApp:mailto:test@test.com
UID:FIXMEUID20180615T105517Z
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ- PARTICIPANT;PARTSTAT=ACCEPTED;RSVP=TRUE
;CN=test@test.com;X-NUM-GUESTS=0:
mailto:test@test.com
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ- PARTICIPANT;PARTSTAT=ACCEPTED;RSVP=TRUE
;CN=another.test@gmail.com;X-NUM-GUESTS=0:
mailto:another.test@gmail.com
CREATED:20180615T105517Z
<h1>Test Email Body</h1>
SEQUENCE:0
SUMMARY:test
LOCATION:test location
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR
对于可能正在查看此问题的任何人,我查看了我从 outlook 约会中保存的 ICS 文件,并使它看起来更像我在 python 中输出的内容。这解决了我的大部分问题。
我正在创建一个 ICS 以附加到带有 python 中的 SMTPLib 和电子邮件库的电子邮件。当我发送会议请求时,它显示为会议请求通常应该在我们的组织内部。当我将会议请求发送给组织外部的人时,它向这些人显示的只是一封纯文本电子邮件,没有接受、拒绝等选项。
下面粘贴的是收到的电子邮件 headers 的输出,其中包括 icalendar 格式。我发现的许多可能的解决方案都是用户端的错误,但是当我发送在 outlook 中创建的会议请求并将其发送到外部电子邮件地址时,它会正常工作。
我的 icalendar 格式不正确吗?
Content-Type: multipart/mixed; boundary
MIME-Version: 1.0
Reply-To: test@test.com
Date: Fri, 15 Jun 2018 10:55:17 -0400
Subject: test
From: test <SchedulerApp@test.com>
To: test@test.com,another.test@gmail.com
Content-Type: multipart/alternative; boundary="
MIME-Version: 1.0
Content-Type: text/html; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
<h1>Test Email Body</h1>
MIME-Version: 1.0
Content-Type: text/calendar; method="PUBLISH"; charset="us-ascii"
Content-Transfer-Encoding: 7bit
BEGIN:VCALENDAR
PRODID://SchedulerApp//test company//en
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:REQUEST
BEGIN:VEVENT
DTSTART:20180616T074500
DTEND:20180616T084500
DTSTAMP:20180615T105517Z
ORGANIZER;CN=SchedulerApp:mailto:test@test.com
UID:FIXMEUID20180615T105517Z
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ- PARTICIPANT;PARTSTAT=ACCEPTED;RSVP=TRUE
;CN=test@test.com;X-NUM-GUESTS=0:
mailto:test@test.com
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ- PARTICIPANT;PARTSTAT=ACCEPTED;RSVP=TRUE
;CN=another.test@gmail.com;X-NUM-GUESTS=0:
mailto:another.test@gmail.com
CREATED:20180615T105517Z
<h1>Test Email Body</h1>
SEQUENCE:0
SUMMARY:test
LOCATION:test location
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR
对于可能正在查看此问题的任何人,我查看了我从 outlook 约会中保存的 ICS 文件,并使它看起来更像我在 python 中输出的内容。这解决了我的大部分问题。