Hi
I am trying to send a new appointment and then in a second step I want to send the cancellation of the appointment. Sending a new appointment works fine (also sending an update of the appointment works). But the cancellation is somehow recognized wrong by outlook. It seems as it is sent as a msg instead of an ics. The cancellation is received as an attachment of the msg.
Aspose1.png (30.3 KB)
The attachment is called “not supported calendar message.ics”. When I open the attachment I can then cancel the meeting which works fine. But it should not be in an attachment, instead it should show up directly as it is in the next screenshot:
Aspose2.png (19.8 KB)
I tried to google about it and the only things I could come up with, where they have the same problem, are the following links. But I cannot translate the solutions to aspose. It also seems that an outlook update has something to do with it.
- phpmailer - iCal calendar events no longer cancelling after outlook update - Stack Overflow
- icalendar - file .ics to delete appointment not recognized by outlook - Stack Overflow
Here is my code of creating the appointment:
SmtpClient client = new SmtpClient(*******);
MailAddressCollection attendees = new MailAddressCollection();
attendees.Add(new MailAddress("*********@gmail.com", "*********"));
MailMessage msg = new MailMessage();
MailAddress fromAddress = new MailAddress("*********@gmail.com", "*******");
msg.From = fromAddress;
msg.To = attendees;
DateTime dtFrom = new DateTime(2020, 11, 20, 15, 15, 0);
DateTime dtUntil = new DateTime(2020, 11, 20, 16, 15, 0);
Appointment app = new Appointment("In the office", dtFrom, dtUntil, fromAddress, attendees);
app.Summary = "Super important Meeting";
app.Description = "This is coming from me.";
msg.AddAlternateView(app.RequestApointment());
msg.Save(msg.MessageId + ".eml", SaveOptions.DefaultEml);
client.Send(msg);
This is my code of cancellling the appointment:
SmtpClient client = new SmtpClient(*******);
MailAddressCollection attendees = new MailAddressCollection();
attendees.Add(new MailAddress("*********@gmail.com", "********"));
MailAddress fromAddress = new MailAddress("*********@gmail.com", "********");
DateTime dtFrom = new DateTime(2020, 11, 20, 15, 15, 0);
DateTime dtUntil = new DateTime(2020, 11, 20, 16, 15, 0);
Appointment app = new Appointment("In the office", dtFrom, dtUntil, fromAddress, attendees);
app.Summary = "Super important Meeting";
app.Description = "This is coming from me.";
app.UniqueId = savedUniqueId; //savedUniqueID from the previousely created appointment*;
app.Status = AppointmentStatus.Cancelled; //added this part while trying to solve the problem
app.MethodType = AppointmentMethodType.Cancel; //added this part while trying to solve the problem
MailMessage msgCancel = new MailMessage("***********@gmail.com", "*********@gmail.com");
msgCancel.Subject = "Cancel appointment";
msgCancel.Body = "cancel appointment";
msgCancel.AddAlternateView(app.CancelAppointment(2));
msgCancel.Save(msgCancel.MessageId + ".eml", SaveOptions.DefaultEml);
client.Send(msgCancel);
I am using the following product versions:
Outlook version: Microsoft Outlook for office 365 MSO (16.0.12527.21230) 32 Bit (just updated to 16.0.12527.21294 and still the same problem)
Aspose.Mail version: 20.10.0