Send appointments to a list of Recipients (exchange 2007) via c#

To use this code, you need to install http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=c3342fb3-fbcc-4127-becf-872c746840e1 , this will create a dll, that you need to import to the project



try
            {
                // TODO: Write implementation for action

                ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
                service.Credentials = new NetworkCredential(ssAuthentication.ssSTAuthentication.ssUsername, ssAuthentication.ssSTAuthentication.ssPassword, ssAuthentication.ssSTAuthentication.ssDomain);
                service.Url = new Uri(ssAuthentication.ssSTAuthentication.ssServiceUrl);

                Appointment appointment = new Appointment(service);
                appointment.Subject = ssSubject;
                appointment.Body = ssDescription;
                appointment.Start = ssStartDate;
                appointment.End = ssEndDate;
                appointment.Location = ssLocation;

                for (int i = 0; i < ssRecipients.Length; i++)
                {
                    appointment.RequiredAttendees.Add(ssRecipients[i].ssSTListOfEmails.ssEmail);
                }

                appointment.Save(SendInvitationsMode.SendOnlyToAll);
            }
            catch (Exception e)
            {
                ssErrors = "The error is: " + e.ToString();
            }