Graph API中的QueryOption搜索电子邮件地址 [英] QueryOption Search in Graph API for email address
本文介绍了Graph API中的QueryOption搜索电子邮件地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在我的已发送文件夹中搜索发送给"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.
这篇关于Graph API中的QueryOption搜索电子邮件地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文