EWS sends invitations to everyone when removing a

2019-07-12 02:43发布

I have the following code:

(Meeting beeing the exchange appointment)

For Each Recipient As String In emailAdresses 
    For i As Integer = 0 To Meeting.RequiredAttendees.Count - 1
        If (Meeting.RequiredAttendees(i).Address).ToUpper() = Recipient.ToUpper() Then
            Meeting.RequiredAttendees.RemoveAt(i)
            Exit For
        End If
    Next
Next

Meeting.Update(ConflictResolutionMode.AutoResolve, SendInvitationsOrCancellationsMode.SendOnlyToChanged)

Now as you can see i'm using SendInvitationsOrCancellationsMode.SendOnlyToChanged.

But even though that i'm using that mode it is still sending the appointment to all of the attendees.

I've looked at msdn and the code is exactly the same. And msdn tells me the following should happen:

Save the meeting and send a meeting cancellation message to the attendee or attendees that you removed

So basically msdn sais it is works but it does not. Is there a work around for this issue or is anyone else experiencing the same problem?

our exchange server is a 2007 SP1 version.

The answer can be in C# or VB.NET, I'll translate it to the language we need.

PS. Adding members and using this mode causes the invite to send to the newly added member only. But as I said before deleting does not have this same behaviour.

2条回答
Deceive 欺骗
2楼-- · 2019-07-12 02:45

Doing:

Meeting.Update(ConflictResolutionMode.NeverOverwrite, SendInvitationsOrCancellationsMode.SendOnlyToChanged)

Instead of:

Meeting.Update(ConflictResolutionMode.AutoResolve, SendInvitationsOrCancellationsMode.SendOnlyToChanged)

Solved my problem, I do not know why and what it was having trouble with though.

查看更多
可以哭但决不认输i
3楼-- · 2019-07-12 03:07

Using ConflictResolutionMode.AutoResolve instead of ConflictResolutionMode.NeverOverwrite did not work for me. After some research, I found out that this is the normal behaviour.

The SendInvitationsOrCancellationsMode enum's values SendOnlyToChanged and SendToChangedAndSaveCopy behave similarly when it comes to sending email (the only difference is that the latter saves a copy of the sent email and the former doesn't):

Send meeting invitations/cancellations only to attendees that have been added or modified

There is no reference to attendees that have been removed. I thought that the work 'modified' here means that, but apparently that is not the case.

This Microsoft Support Article (Article ID: 2873493) says that this is the expected behaviour:

EWS issue: SentToChangeAndSaveCopy parameter in Appointment.Update method does not work

Symptoms

Consider the following scenario:

  • You build an Exchange Web Services (EWS) application to update a meeting request in a Microsoft Exchange Server 2010 environment.

  • One or more invitees in the meeting request are externals or distribution lists.

  • You use the Appointment.Update method together with the SentToChangeAndSaveCopy parameter to remove one invitee from the meeting request and to update the meeting request.

In this scenario, a meeting update is sent to all invitees.

Cause

This behavior is expected.

查看更多
登录 后发表回答