Free Support Forum - aspose.com

Creating and updating an Exchange Meeting Request

Is there a way to create, update and cancel, a meeting request? Are there any examples or documentation to do this?


This message was posted using Page2Forum from Miscellaneous Demos Demos - Aspose.Network Demos

Hi,


Thanks for considering Aspose.

Please refer to http://www.aspose.com/documentation/.net-components/aspose.network-for-.net/send-meeting-requests.html page for sample code and documentation for creating a meeting request. An article is available at http://www.aspose.com/documentation/.net-components/aspose.network-for-.net/cancel-meeting-requests-with-calendar.html for cancelling meeting requests.

In the below example, I have merged all 3 create, update and delete examples.
Please note that, first we get Appointment.UniquieID when the appointment is created. And we use this unique ID to later update and cancel the appointment.

try
{
Console.WriteLine(“Trying to send an email with meeting request…”);
SmtpClient client = new SmtpClient(host, port, username, password);
if (isSSL == true)
{
client.Port = portSSL;
client.EnableSsl = true;
client.SecurityMode = SmtpSslSecurityMode.Explicit;
}
MailMessage message = new MailMessage(sender, recipient, “05 - test email - single meeting request”, “test email”);
// create the meeting request
Appointment app = new Appointment(“meeting request”, DateTime.Now.AddHours(1),
DateTime.Now.AddHours(1.5), sender, recipient);
app.Summary = “meeting request summary”;
app.Description = “description”;
message.AddAlternateView(app.RequestApointment());
client.Send(message);
Console.WriteLine(“Meeting request sent. Please check Inbox. Next step is to Update this appointment.”);

// update appointment - time one hour later
Appointment appUpdate = new Appointment(“meeting request”, DateTime.Now.AddHours(1),
DateTime.Now.AddHours(1.5), sender, recipient);
appUpdate.UniqueId = app.UniqueId;
appUpdate.StartDate = app.StartDate.AddHours(1);
appUpdate.EndDate = app.StartDate.AddHours(1);
appUpdate.Location = “update meeting request”;
appUpdate.Summary = “update meeting request summary”;
appUpdate.Description = “update”;

MailMessage msgUpdate = new MailMessage(sender, recipient, “06 - test email - update meeting request”, “test email”);
msgUpdate.AddAlternateView(appUpdate.UpdateAppointment());
client.Send(msgUpdate);
Console.WriteLine(“Update request sent. Please check Inbox. The appointment should be updated in Calendar. Next step is to cancel this appointment.”);

// cancel appointment
Appointment appCancel = new Appointment(“meeting request”, DateTime.Now.AddHours(1),
DateTime.Now.AddHours(1.5), sender, recipient);
appCancel.UniqueId = app.UniqueId;
appCancel.Location = “cancel meeting request”;
appCancel.Summary = “cancel meeting request summary”;
appCancel.Description = “cancel”;

MailMessage msgCancel = new MailMessage(sender, recipient, “07 - test email - cancel meeting request”, “test email”);
msgCancel.AddAlternateView(appCancel.CancelAppointment());
client.Send(msgCancel);
Console.WriteLine(“Cancel request sent. Please check Inbox. A cancel meeting request should be present in Inbox.”);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}