我正在处理的应用程序会自动发送包含ICS文件的电子邮件以进行会议邀请.这些电子邮件的回复地址中带有+签名.
The application I am working on sends automatic emails with ICS files for meeting invites. These emails have a reply-to address with a + sign in it.
这在Google日历和gmail中可以正常工作,但是在Outlook中被替换为space.直到大约一个月前,这在前景方面也很好.
This works fine in google calendar and gmail, but gets replaced by a space in outlook. This was working fine in outlook also until about a month ago.
如何指示Outlook不要将其解释为? 以下是一些相关的屏幕截图:
How do I instruct outlook not to interpret it as a ? Following are some relevant screenshots:
推荐答案
有一些反复试验,我发现只有在电子邮件中有.ics文件并且Outlook正在解码组织者的电子邮件地址由于某种原因.因此,event+yi76iq@domain被转换为event yi76iq@domain.
With a few trial-and-errors, I found out that this happens only when there is an .ics file in the email and that outlook was decoding the organizer's email address for some reason. So, event+yi76iq@domain was converted to event yi76iq@domain.
因此,我在准备日历事件的.ics时对电子邮件地址进行了编码.这是代码段-(我在这里使用django,并且已经使用urlencode来编码电子邮件地址).
So, I encoded the email address while preparing the .ics for the calendar event. Here is a snippet of the code - (I am using django here and I have used urlencode to encode the email address).
from django.utils.http import urlquote . . organizer = vCalAddress(u"mailto:{}".format(urlquote(communication_sending_email))) #<-- This is the only difference. I have encoded the email address. organizer.params['cn'] = vText(organizer_full_name) event.add('organizer', organizer) cal = Calendar() cal.add_component(event).ics文件中的结果为event%2Byi76iq%40domain.我在 Google日历和 Outlook 中都对此进行了测试,并且有效.
The result in the .ics file is event%2Byi76iq%40domain. I tested this in both Google calendar and Outlook and it worked.
更多推荐
电子邮件地址中的“加号"将转换为Outlook中的空格
发布评论