使用Exchange Web服务发送回复电子邮件 - 如何处理changeKey属性

Chr*_*des 5 service exchange-server exchangewebservices web

对于我的代码,我从交换中检索未读消息,根据该消息进行一些处理,然后使用我所做的处理结果回复消息.

The problem that I'm having is that when I attempt to reply to the email I'm getting the below error on calling responseMessage.send() or responseMessage.sendAndSave():

The current ChangeKey is required for this operation.
Run Code Online (Sandbox Code Playgroud)

Below is the code that I am running that is triggering this error:

public void replyToEmail(EmailMessage _emailMessage, String _reply)
    {

        String serviceManager = emailServerAddress = ConfigurationSettings.AppSettings["serviceManagerEmail"].Trim();
        ResponseMessage responseMessage = _emailMessage.CreateReply(true);
        responseMessage.BodyPrefix = _reply;

        String changekey = _emailMessage.Id.ChangeKey;

        if (!serviceManager.Equals(""))
        {
            responseMessage.CcRecipients.Add(new EmailAddress(serviceManager));
        }

        responseMessage.Send();
    }
Run Code Online (Sandbox Code Playgroud)

I'm able to check the _emailMessage changeKey value via _emailMessage.id.Changekey and there is a value there, I would have expected that to be assigned to the responseMessage when _emailMessage.createReply() was call. I'm unable to find a way to manually assign it.

I've been unable to find any references to this issue during searching, I was hoping someone

Tri*_*dus 5

在设置消息IsRead = true并将该更新保存回服务器之后,我遇到了.Forward这个问题.这改变了ChangeKey,因此它不再有效.

尝试执行_emailMessage.Load()以再次从服务器获取消息,以及新的ChangeKey.