电子邮件地址中的 'plus' 符号在 outlook 中转换为 space
The 'plus' sign in the email address is converted to space in outlook
我正在处理的应用程序会自动发送带有 ICS 文件的电子邮件以获取会议邀请。这些电子邮件有一个 reply-to 地址和 +
标志。
这在 google 日历和 gmail 中工作正常,但在 outlook 中被 space
取代。直到大约一个月前,这在 outlook 中也运行良好。
如何指示 outlook 不将其解释为 ?
以下是一些相关的屏幕截图:
经过几次反复试验,我发现只有当电子邮件中有 .ics
文件并且 outlook 出于某种原因正在解码组织者的电子邮件地址时才会发生这种情况。因此,event+yi76iq@domain.com
被转换为 event yi76iq@domain.com
。
因此,我在为日历活动准备 .ics
时对电子邮件地址进行了编码。这是代码片段 - (我在这里使用 django
并且我使用 urlencode
对电子邮件地址进行编码)。
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.com
。我在 Google calendar 和 Outlook 中测试了这个并且它有效。
我正在处理的应用程序会自动发送带有 ICS 文件的电子邮件以获取会议邀请。这些电子邮件有一个 reply-to 地址和 +
标志。
这在 google 日历和 gmail 中工作正常,但在 outlook 中被 space
取代。直到大约一个月前,这在 outlook 中也运行良好。
如何指示 outlook 不将其解释为 ? 以下是一些相关的屏幕截图:
经过几次反复试验,我发现只有当电子邮件中有 .ics
文件并且 outlook 出于某种原因正在解码组织者的电子邮件地址时才会发生这种情况。因此,event+yi76iq@domain.com
被转换为 event yi76iq@domain.com
。
因此,我在为日历活动准备 .ics
时对电子邮件地址进行了编码。这是代码片段 - (我在这里使用 django
并且我使用 urlencode
对电子邮件地址进行编码)。
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.com
。我在 Google calendar 和 Outlook 中测试了这个并且它有效。