Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cant update exchange appointment in EWS

Im using EWS to update exchange appointments but sometimes I can't update them after they are created. I'm receiving:

"At least one recipient isn't valid., A message can't be sent because it contains no recipients."

The code is essentially:

Appointment appointment = getAppointment();
... set some properties
appointment.Update(ConflictResolutionMode.AlwaysOverwrite, SendInvitationsOrCancellationsMode.SendToNone);

Isn't that supposed to work? Beforehand I didn't use the SendInvitationsOrCancellationsMode.SendToNone enum, but even with that I get the same exception.

It's never a problem to create the appointment, it's always the updates that we are having problems with.

like image 915
freakshow Avatar asked Jan 16 '26 22:01

freakshow


1 Answers

For the sake of the log, I send a solution here. I managed to solve it with a workaround. It accepts it if I add a new item to the OptionalAttendees collection, when it is empty. Since I add the SendInvitationsOrCancellationsMode.SendToNone flag, it will send nothing, but finally accepts it without an exception.

if (EWSItem.OptionalAttendees.Count == 0)
    EWSItem.OptionalAttendees.Add("[email protected]");
    EWSItem.Update(ConflictResolutionMode.AlwaysOverwrite,
                   SendInvitationsOrCancellationsMode.SendToNone);
like image 103
Hudgi Avatar answered Jan 19 '26 19:01

Hudgi