s22 ImapClient code example
Example: s22.imap meeting request
IMail email = new MailBuilder().CreateFromEml(client.GetMessageByUID(uid));
foreach (Appointment appointment in email.Appointments)
{
if (appointment.Method == Method.Request)
{
string summary = appointment.Event.Summary;
DateTime? start = appointment.Event.Start;
DateTime? end = appointment.Event.End;
string location = appointment.Event.Location;
Console.WriteLine("{0} at {1} ({2}-{3})", summary, location, start, end);
foreach (Participant participant in appointment.Event.Participants)
{
Console.WriteLine("Common name: " + participant.Cn);
Console.WriteLine("Email: " + participant.Email);
Console.WriteLine("Participation status: " + participant.Status);
}
}
else if (appointment.Method == Method.Cancel)
{
Console.WriteLine("Event was cancelled: " + appointment.Event.UID);
}
else if (appointment.Method == Method.Reply)
{
foreach (Participant participant in appointment.Event.Participants)
{
if (participant.Status == ParticipationStatus.Accepted)
Console.WriteLine("Event was accepted by: " + participant.Email);
else if (participant.Status == ParticipationStatus.Declined)
Console.WriteLine("Event was declined by: " + participant.Email);
}
}
}