使用 WebDAV 和 C# 读取电子邮件的主题和正文
我正在使用 Microsoft 的 this 示例来阅读使用 WebDAV 的电子邮件的主题。我也想阅读正文,但不确定如何处理。我相信这段代码是需要修改的:
strQuery = "<?xml version=\"1.0\"?><D:searchrequest xmlns:D = \"DAV:\" >"
+ "<D:sql>SELECT \"DAV:displayname\" FROM \"" + strRootURI + "\""
+ "WHERE \"DAV:ishidden\" = false AND \"DAV:isfolder\" = false"
+ "</D:sql></D:searchrequest>";
如您所见,这段代码仅返回对象的显示名称。如何修改它以返回主体?
I am using this example from Microsoft to read the subject of an email using WebDAV. I would also like to read the body, but am unsure how to approach this. I believe this code is what needs to be modified:
strQuery = "<?xml version=\"1.0\"?><D:searchrequest xmlns:D = \"DAV:\" >"
+ "<D:sql>SELECT \"DAV:displayname\" FROM \"" + strRootURI + "\""
+ "WHERE \"DAV:ishidden\" = false AND \"DAV:isfolder\" = false"
+ "</D:sql></D:searchrequest>";
As you can see, this code only returns the displayname of the object. How can this be modified to return the body as well?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于感兴趣的人,我了解了如何引用电子邮件正文。
首先,查询被修改为以下内容:
然后,使用了一些额外的代码来引用响应中的正文:
这是完整的代码:
我希望这对某人有帮助!
For anyone interested, I found out how to reference the body of the email.
First the query was modified to the following:
Then, a little bit of extra code was used to reference the body from the response:
Here's the full code:
I hope this helps someone!