托管 EWS - 使用来自酒店的替代选项回复帖子
在托管 Exchange Web 服务中,有一个类 PostItem,可以使用 ExchangeService 对象实例化。
但是在分配包括 InReplyId 和 From 在内的所有属性并调用 Save(folderId) 方法之后:
PostItem newPost = new PostItem(mService);
newPost.InReplyTo = originalPost.Id.UniqueId;
newPost.From = new EmailAddress( "Max Gontar", "[email protected]" );
newPost.Subject = msg.Subj;
newPost.Body = msg.TextBody;
newPost.Save(mCurrentFolderId);
它仍然创建一个单独的帖子,而不是回复帖子:
我尝试过的其他方式:
PostReply reply = originalPost.CreatePostReply();
reply.Subject = msg.Subj;
reply.Body = msg.TextBody;
reply.Save( currentFolder.Id )
无法设置来自属性,因此它应该使用当前凭据联系人电子邮件地址创建帖子回复。 但是它给出了 null!
你能帮助我吗?
谢谢你!
In managed Exchange Web Services there is a class PostItem, which can be instantiate with ExchangeService object.
But after assigning all properties including with InReplyId and From, and calling Save(folderId) method:
PostItem newPost = new PostItem(mService);
newPost.InReplyTo = originalPost.Id.UniqueId;
newPost.From = new EmailAddress( "Max Gontar", "[email protected]" );
newPost.Subject = msg.Subj;
newPost.Body = msg.TextBody;
newPost.Save(mCurrentFolderId);
It still creates a separate Post, not a Reply Post:
Other way I have tried:
PostReply reply = originalPost.CreatePostReply();
reply.Subject = msg.Subj;
reply.Body = msg.TextBody;
reply.Save( currentFolder.Id )
There is no way to set From property, so it should create Post Reply with current credentials Contact email address. But it gives null there!
Can you help me?
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我刚刚学习这个 api,但这段代码可能有效:
Im just learning about this api but this code may work: