Exchange Web服务创建的答复不正确的发送日期时间时区 [英] Exchange Webservices Create Reply Incorrect Sent Datetime timezone

查看:122
本文介绍了Exchange Web服务创建的答复不正确的发送日期时间时区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,可以自动执行公司服务台和客户之间的电子邮件通信. 当应用程序需要回复现有的电子邮件时,我使用FindItems来获取电子邮件,然后加载所需的属性,然后使用(CreateReply)来获取我需要发送的响应电子邮件. 奇怪的行为如下: 我需要回复的电子邮件具有正确的SentDateTime和时区(+4 GMT),但是当我从中创建回复时,已回复电子邮件"的发送日期变为UTC,这毫无意义! 当我正确连接以进行交换时,我正在指定时区,但我似乎找不到一种方法来指定创建的回复消息的时区.

我真的希望有人对此有所了解.

仅需指出,当我使用Outlook手动回复电子邮件时,回复电子邮件的发送日期时间是正确的.仅当我使用Exchange Web服务时才会出现此问题.

问候 Yazeed

解决方案

之所以会发生此问题,是因为EWS托管API在大多数请求中都忽略了发送TimeZone标头.对于回复,您确实需要发送时区标头,否则它将标头信息设置为UTC.一种解决方法是使用事件将时区标头添加回请参阅

I really hope someone knows anything about this.

Just to point out, when i use outlook to manually reply to emails, the replied to email sent date time is correct. The problem only happens when i use exchange web services.

Regards Yazeed

解决方案

This problem happens because the EWS Managed API omits sending the TimeZone headers in most requests. For the reply, forwards you do need send the timezone headers else it will set the header information to UTC. One workaround is to use the events to add the timezone header back in see http://blogs.msdn.com/b/emeamsgdev/archive/2014/04/23/ews-missing-soap-headers-when-using-the-ews-managed-api.aspx . The source for the EWS Managed API is also available now so you could also patch the GetTimeZoneRequired method and recompile the library https://github.com/OfficeDev/ews-managed-api/blob/31951f456519786e41232fa9ff6a3ab20b56cac3/Core/ServiceObjects/Items/Item.cs .

Cheers Glen

这篇关于Exchange Web服务创建的答复不正确的发送日期时间时区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆