1

I am trying to send an iCalendar formatted ics file from App Engine using the App Engine mail API. This works great in GMail. However, Outlook doesn't recognise the file, and I believe the issue is that the content-type is set to "text/calendar" and not "text/calendar; method=REQUEST".

I have tried sending mail with telnet with and without "method=REQUEST" to find that Outlook only actions the ics file if this is included. I have checked the headers sent from App Engine, to find that they do not include method=REQUEST and that is why I believe this is the problem.

I have also seen other people report this issue here and here. There is a java solution to the first link, but having now gone through the App Engine mail api with a fine toothcomb I have so far been unable to set the content-type using Python.

I have tried overriding the EXTENSION_MIME_MAP dict:

mail.EXTENSION_MIME_MAP['ics'] = 'text/calendar; charset=utf-8; method=REQUEST;'

and setting the header myself:

message.headers = {'content-type': 'text/calendar; charset=utf-8; method=REQUEST;'}

Both were a long shot, and unsurprisingly, neither work.

So how can this be done?

Community
  • 1
  • 1
Gwyn Howell
  • 5,365
  • 2
  • 31
  • 48
  • 1
    UPDATE: I contacted google support who confirmed this was not possible. I managed to work around by implementing the SendGrid SMTP API, which actually works a treat. – Gwyn Howell Jun 10 '14 at 11:31
  • Did you find any other way of sending email from appengine for python apart from send_mail? I need to send .ics files but apart from Yahoo no one is recognizing the invite in the browser. And I really want to use some native service to AppEngine rather than paid third party ones. Thanks in advance! – Hassan Feb 05 '15 at 14:32
  • 1
    It's not possible using app engine native apis. Use sendgrid - since I set it up, I have to say that it's worked flawlessly. And they also have quite a generous free tier. I've been quite impressed with the service. I'd recommend at least giving it a try, it's easy to integrate with App Engine. – Gwyn Howell Feb 05 '15 at 14:48
  • Didnt see their free tier, will surely give them a try. Thanks especially for the prompt reply. – Hassan Feb 05 '15 at 15:57

0 Answers0