views:

143

answers:

3

I have an application, it is creating an ICS similar to the following:

BEGIN:VCALENDAR
VERSION:2.0
METHOD:REQUEST
BEGIN:VEVENT
ATTENDEE;ROLE=REQ-PARTICIPANT;RSVP=TRUE:MAILTO:[email protected]
ORGANIZER:MAILTO:[email protected]
DTSTART:20100803T190000Z
DTEND:20100803T200000Z
LOCATION:Go to http://100.200.0.55/Login/ParticipantLogIn.asp and enter
   Conference ID: 0000
SEQUENCE:0
UID:352C75A6-0117-4B3A-AFE6-7B18649CD45A
DTSTAMP:20100803T184455Z
DESCRIPTION:TO ACCESS THE WEB CONFERENCE:\n\n    Click on the link bel
  ow:\n
SUMMARY:Test User's Conference
PRIORITY:5
CLASS:PUBLIC
BEGIN:VALARM
TRIGGER:-PT15M
ACTION:DISPLAY
DESCRIPTION:Reminder
END:VALARM
END:VEVENT
END:VCALENDAR

When sent to a Gmail account it is being sent as an ICS file and everything is correct. When sent to Outlook 2003 or 2007, it is attached as a .msg file and is binary. The server being used is Windows Server 2008. I have set ics mime type as text/calendar on it. The process for adding it is just creating a tmp file on disk and adding it as an attachment, then sending using CDO. Does anyone know any reason why Outlook would be adding it as a .msg?

Also, we use the same exchange server and it works fine from Windows Server 2003.

Updating with network trace for the attachment

2003

X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4073

Content-Type: application/octet-stream;
    name="meeting.ics"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
    filename="meeting.ics"

2008

X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6002.18197
Content-Type: text/calendar;
    name="meeting.ics"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
    filename="meeting.ics"

In both there are four message parts:

  1. Text
  2. HTML
  3. Attachment 1
  4. Attachment 2

In the 2003 version that works, one is an application/octet stream and one is calendar/text. In 2008 they both are calendar/text.

+3  A: 

This looks to be a problem with CDO on Windows Server 2008. Doing a trace of the network traffic on each server showed a huge difference in the message being passed.

It appears as if for some reason the AddAttachment method is not using the same MIME as in 2003. Manually adding the attachment and controlling the MIME will fix it.

Corv1nus
+4  A: 

It is possible that the TNEF data is missing from the email. If this is the case then the email would be rendered as plain text. You should check the TNEF settings to see if it beings stripped from emails.

Check in ESM to see if the option to remove TNEF is ON.

From MSDN:

In addition to the receiving client, it is not uncommon for a mail server to strip out TNEF information from mail messages as it delivers them. If a server option to remove TNEF is turned on, clients will always receive a plain text version of the message. Microsoft Exchange Server is an example of a mail server application that has the option to remove TNEF from messages.

Alison
Clients receive HTML messages fine but, I can check this in the attachments to verify. It is quite odd, as TXT attachments are also fine (which would support your answer). It is just ICS that is getting screwed up.
Corv1nus
+1  A: 

Do you add VCALENDAR as the main (and only) MIME part or as one of the attachments? There is a big difference.

Dmitry Streblechenko
I add a text file (Meeting.ics), or what was a text file until WinServer 2008, with the ICS text in it as an attachment. I set the mime to text/calendar.
Corv1nus
Then you get the expected result: a regular mail message with an attached appointment.Your ICS must be the only MIME part and the message header itself must specify the type as text/calendar.
Dmitry Streblechenko
BTW, what does your network traffic trace show? Can you post the whole MIME message as it is beign sent over the wire?
Dmitry Streblechenko
Yeah, I will post it on Monday. Why does it work this way in 2003 and earlier versions then? It's using the CDO AddAttachment with the IBodyPart set up as in similar to here: http://msdn.microsoft.com/en-us/library/aa487387(v=EXCHG.65).aspx
Corv1nus
Updated and added.
Corv1nus
Updated again, this time it may actually be helpful...
Corv1nus