Click here to Skip to main content
15,922,523 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey Everyone,

I have run into a real tough issue that I have just been completely stumped on. I have to create a meeting request via E-Mail to Outlook using the VCALENDAR format. I can create .ics files all day long and they work great as attachments, but they want it as an actual meeting request, not an attachment.

The code I use to send the email will follow, but the problem is this: When I send the calendar via email, no matter what I do, none of the "Required" or "Optional" attendees show. To see what I mean, click here:
Appointment Format[^]

Do any of you have any idea how to make this work?

Code:

System.Net.Mime.ContentType calendarType = new        System.Net.Mime.ContentType("text/calendar");

     //  Add parameters to the calendar header
     calendarType.Parameters.Add("method", "REQUEST");
     calendarType.Parameters.Add("name", "meeting.ics");

     MailMessage msg = new MailMessage();

     AlternateView calendarView = AlternateView.CreateAlternateViewFromString(GetVCalendar().ToString(), calendarType);
     //calendarView.TransferEncoding = TransferEncoding.SevenBit;
     msg.AlternateViews.Add(calendarView);

     msg.To.Add("some.recipient@myco.com");
     msg.From = new MailAddress("my.service@myco.com");
    // msg.Subject = "This time with Publish - still a problem";
   //  msg.Body = GetVCalendar().ToString();

     string mailServer = "extrelay.myco.com";
     SmtpClient client = new SmtpClient(mailServer);
     client.Send(msg);


This is the string retrieved by GetVCalendar() --

BEGIN:VEVENT
ATTENDEE;CN="Someone Else";ROLE=OPT-PARTICIPANT;RSVP=FALSE:mailto:Some
    one.else@myco.com
CLASS:PUBLIC
CREATED:20100804T132739Z
DTEND:20100806T030101Z
DTSTAMP:20100804T132739Z
DTSTART:20100806T020101Z
LAST-MODIFIED:20100804T132739Z
LOCATION:Some Location
ORGANIZER;CN="Some Organizer":mailto:Some.Organizer@myco.com
PRIORITY:Normal
SEQUENCE:0
SUMMARY;LANGUAGE=en-us:Some Title
TRANSP:OPAQUE
UID:700cfaa62f1d4c1f9c042b2c34224bb7
X-ALT-DESC;FMTTYPE=text/html:<html><head><title>This is a title</title><
    /head><body><span style="color:Lime">This is LIME green!</span></body></
    html>
X-MICROSOFT-CDO-BUSYSTATUS:BUSY
X-MICROSOFT-CDO-IMPORTANCE:Normal
X-MICROSOFT-DISALLOW-COUNTER:TRUE
X-MS-OLK-ALLOWEXTERNCHECK:TRUE
X-MS-OLK-APPTSEQTIME:20100804T132739Z
X-MS-OLK-AUTOFILLLOCATION:TRUE
X-MS-OLK-CONFTYPE:0
BEGIN:VALARM
TRIGGER:-PT15M
ACTION:DISPLAY
DESCRIPTION:Reminder
END:VALARM
END:VEVENT
Posted
Updated 4-Aug-10 5:01am
v4

1 solution

Well... as it turns out, we were missing a property on the ATTENDEE property. There is a property called EXPECT=xxxx where xxxx is FYI, REQUIRE, REQUEST, or IMMEDIATE.

Once you add those to each ATTENDEE, it works perfectly.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900