ICS Email Attachment Not Working for Exchange Users
I am sending a meeting invitation as an email with an ICS attachment from a Java web application. Everything works fine when I send it to Outlook users who are not using an Exchange server. They get the appropriate Accept/Reject buttons and can add the meeting to their calendar.
Things are not working for users who are on an Exchange server, however. They get a meeting invite, but it lists themselv开发者_如何学Ces as the meeting organizer and they are unable to change any of the meeting details. They cannot accept or reject and cannot add it to their calendar.
It is almost like Exchange is altering or does not like the format of the ICS we are sending, but normal Outlook handles it just fine.
Here is the ICS we are sending. Does anyone know what we can change to make this work for Exchange users, in addition to Gmail and non-Exchange Outlook Users.
BEGIN:VCALENDAR
PRODID:-//fincrm//iCal4j 1.0//EN
VERSION:2.0
METHOD:REQUEST
BEGIN:VEVENT
UID:128
DTSTAMP:20110927T191127Z
DTSTART;VALUE=DATE-TIME:20110928T082000
DTEND;VALUE=DATE-TIME:20110928T085000
ACTION:DISPLAY
DESCRIPTION:Time is set to 8:20 AM
SEQUENCE:0
ORGANIZER:MAILTO:user1@ltest.com
LOCATION:Financial CRM Application
ATTENDEE:MAILTO:user2@test2.com
SUMMARY:CRM Task #128
END:VEVENT
END:VCALENDAR
I appreciate your suggestions.
I have figured out that sending the ICS as a Multipart MIME Message seems to work with both Gmail and Exchange. Here is some of the relevant Java code ("calendar" is the ICS string)
// Create an alternative Multipart
Multipart mp = new MimeMultipart("alternative")
BodyPart textPart = new MimeBodyPart();
textPart.setText(eventDescription);
BodyPart calPart = new MimeBodyPart();
calPart.addHeader("content-class", "urn:content-classes:calendarmessage")
calPart.setContent(calendar.toString(), "text/calendar;method=REQUEST")
mp.addBodyPart(textPart);
mp.addBodyPart(calPart);
I know that the is from a while ago, but you can solve this with the registry fix found here:
http://support.microsoft.com/kb/944094
I have tested this with Outlook 2010 running on Exchange 2010 and this allowed 3rd party events to be entered into the calendar when you are the organizer.
I have found that if the organizer is set to you, then Outlook 2011 on Mac will not offer to add the meeting to your Calendar. Removing the Organizer from the meeting seems to work well enough.
I have also found that if the ICS attachment is not the last item attached to a multipart message, it will be stripped.
精彩评论