QueryOption 在 Graph API 中搜索电子邮件地址 [英] QueryOption Search in Graph API for email address

查看:27
本文介绍了QueryOption 在 Graph API 中搜索电子邮件地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的已发送文件夹中搜索发送到john.smith1@gmail.com"的每封电子邮件

I would like to search in my sent folder for every email that is sent to "john.smith1@gmail.com"

我尝试了以下

 List<QueryOption> queryOptions = new List<QueryOption> { new QueryOption("$search", "john.smith1@gmail.com") }; 

List<QueryOption> queryOptions = new List<QueryOption> { new QueryOption("$search", "john.smith1%40gmail.com") }; 

 List<QueryOption> queryOptions = new List<QueryOption> { new QueryOption("$search", "to:john.smith1@gmail.com") }; 

List<QueryOption> queryOptions = new List<QueryOption> { new QueryOption("$search", "to:john.smith1%40gmail.com") }; 

  var messages = await client.Users["myuser@mydomain.com"].Messages.Request(queryOptions ).GetAsync();

以上都不起作用.它抱怨任何非字母字符(它似乎不接受数字、点、:")

none of the above works. It complains of any non alpha character ( it seems it does not accept number, dot, ":" )

有什么建议吗?谢谢.

推荐答案

这样使用 -

List<QueryOption> queryOptions = new List<QueryOption>
{                                                  
    new QueryOption("$search", "%22abcd02%40gmail.com%22") 
}; 

%22 只不过是双引号.我们只是将它连接起来工作.

%22 is nothing but the double quotes. We are just concatenating it to work.

这篇关于QueryOption 在 Graph API 中搜索电子邮件地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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