Exchange Web服务创建的答复不正确的发送日期时间时区 [英] Exchange Webservices Create Reply Incorrect Sent Datetime timezone
问题描述
我有一个应用程序,可以自动执行公司服务台和客户之间的电子邮件通信. 当应用程序需要回复现有的电子邮件时,我使用FindItems来获取电子邮件,然后加载所需的属性,然后使用(CreateReply)来获取我需要发送的响应电子邮件. 奇怪的行为如下: 我需要回复的电子邮件具有正确的SentDateTime和时区(+4 GMT),但是当我从中创建回复时,已回复电子邮件"的发送日期变为UTC,这毫无意义! 当我正确连接以进行交换时,我正在指定时区,但我似乎找不到一种方法来指定创建的回复消息的时区.
我真的希望有人对此有所了解.
仅需指出,当我使用Outlook手动回复电子邮件时,回复电子邮件的发送日期时间是正确的.仅当我使用Exchange Web服务时才会出现此问题.
问候 Yazeed
之所以会发生此问题,是因为EWS托管API在大多数请求中都忽略了发送TimeZone标头.对于回复,您确实需要发送时区标头,否则它将标头信息设置为UTC.一种解决方法是使用事件将时区标头添加回请参阅 https://github.com/OfficeDev/ews-managed-api/blob/31951f456519786e41232fa9ff6a3ab20b56cac3/Core/ServiceObjects/Items/Item.cs .>
欢呼 格伦
I have an application that automates email communications between my companies service desk and customers. When the application needs to reply to an existing email, i use FindItems to get the email and then i load the properties i need, then i use (CreateReply) to get the response email i need to send. The strange behavior is as follows: The email i need to reply to has a correct SentDateTime and timezone (+4 GMT) but when i create a reply from it the sent date of the "replied to email" becomes UTC which makes no sense! I am specifying the timezone when i am connecting to exchange correctly and i cant seem to find a way to specify the timezone of the created reply message.
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屋!