2
votes

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.

1
Hi @freakshow, Have you found a solution? I just faced exactly the same. Thx.Hudgi

1 Answers

1
votes

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);