Search code examples
outlookicalendar

The 'plus' sign in the email address is converted to space in outlook


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.

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.

How do I instruct outlook not to interpret it as a ? Following are some relevant screenshots:

enter image description here

enter image description here


Solution

  • 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, [email protected] was converted to event [email protected].

    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)
    

    The result in the .ics file is event%2Byi76iq%40domain.com. I tested this in both Google calendar and Outlook and it worked.