Sending Calendar Appointments in ASP.Net to Outlook and Lotus Notes

I have created a .Net recruitment website that allows an administrator to set up interviews for candidates.

I am now wanting to extend the functionality so that a site administrator can send Outlook and/or Lotus Notes invitation requests to certain people.
If it was just a case of sending an email to the people then I wouldn't have any trouble. But, does anyone know how you go about sending an invitation request instead? Would the code need to be different for recipients with Outlook or Lotus Notes?

Also, how would I manage the invitation rejects and accepts, is it possible to set a From field that would receive these?

Any advice would be much appreciated.
robert_rawAsked:
Who is Participating?
 
CodeCruiserCommented:
I am not sure about Lotus Notes but i think you could be able to use the following code to create calender files and send them via email.
                System.Text.StringBuilder sbICSFile =
                    new System.Text.StringBuilder();
                DateTime dtNow = DateTime.Now;
 
                sbICSFile.AppendLine("BEGIN:VCALENDAR");
                sbICSFile.AppendLine("VERSION:2.0");
                sbICSFile.AppendLine("PRODID:-//ICSTestCS/");
                sbICSFile.AppendLine("CALSCALE:GREGORIAN");
 
                // Define time zones.
                // GMT
                sbICSFile.AppendLine("BEGIN:VTIMEZONE");
                sbICSFile.AppendLine("TZID:GMT");
                sbICSFile.AppendLine("BEGIN:STANDARD");
                sbICSFile.AppendLine("DTSTART:20071104T020000");
                sbICSFile.AppendLine("RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=11");
                sbICSFile.AppendLine("TZOFFSETFROM:+0000");
                sbICSFile.AppendLine("TZOFFSETTO:+0000");
                sbICSFile.AppendLine("TZNAME:GMT");
                sbICSFile.AppendLine("END:STANDARD");
                sbICSFile.AppendLine("BEGIN:DAYLIGHT");
                sbICSFile.AppendLine("DTSTART:20070311T020000");
                sbICSFile.AppendLine("RRULE:FREQ=YEARLY;BYDAY=2SU;BYMONTH=3");
                sbICSFile.AppendLine("TZOFFSETFROM:+0000");
                sbICSFile.AppendLine("TZOFFSETTO:+0000");
                sbICSFile.AppendLine("TZNAME:GMT");
                sbICSFile.AppendLine("END:DAYLIGHT");
                sbICSFile.AppendLine("END:VTIMEZONE");
 
                // Define the event.
                sbICSFile.AppendLine("BEGIN:VEVENT");
 
                sbICSFile.AppendLine("SUMMARY:Test");
                sbICSFile.AppendLine("DESCRIPTION: Test");
                sbICSFile.AppendLine("PRIORITY:3");
                sbICSFile.AppendLine("UID:1");
                sbICSFile.AppendLine("SEQUENCE:0");
                sbICSFile.AppendLine("ATTENDEE;CN=test@test.com;ROLE=REQ-PARTICIPANT;RSVP=TRUE:MAILTO:test@test.com);
                sbICSFile.Append("DTSTAMP:" + dtNow.Year.ToString());
                sbICSFile.Append(FormatDateTimeValue(dtNow.Month));
                sbICSFile.Append(FormatDateTimeValue(dtNow.Day) + "T");
                sbICSFile.Append(FormatDateTimeValue(dtNow.Hour));
                sbICSFile.AppendLine(FormatDateTimeValue(dtNow.Minute) + "00");
 
                sbICSFile.AppendLine("END:VEVENT");
                sbICSFile.AppendLine("END:VCALENDAR");
 
                Response.ContentType = "text/calendar";
                Response.AddHeader("content-disposition",
                    "attachment; filename=CalendarEvent1.ics");
                Response.Write(sbICSFile);
                Response.End();

Open in new window

0
 
robert_rawAuthor Commented:
Hi CodeCruiser, thanks for your help with this, although ultimately I didn't use the code you supplied (I used code I found at: http://chuckdotnet.blogspot.com/) the code you did provide however did point me in the right direction to the solution and therefore, I am happy to award you the points.
0
 
CodeCruiserCommented:
Glad to help. Thank you.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.