douhushen3241 2017-10-12 19:59
浏览 70
已采纳

我们可以通过一次通话从收件箱和发件箱中获取电子邮件(gmail API PHP)

i'm using Gmail API to fetch messages. if i do like this

$labelIds = ['INBOX'];
$opt_params=[
    'labelIds' => $labelIds,
];
$list = $gmail->users_messages->listUsersMessages('me',$opt_params);

it will work fine. and return messages. but if i mention SENT label with INBOX then it return nothing. what am i doing wrong?

$labelIds = ['INBOX', 'SENT'];

i want to fetch emails from both inbox and sentbox in one call.

  • 写回答

1条回答

  • dpjpo746884 2017-10-12 20:26
    关注

    Your code lists messages that has both the INBOX and SENT labels. You can list messages that has either one with the OR operator:

    $opt_params=[
        'maxResults' => 50,
        'q' => 'in:inbox OR in:sent',
    ];
    $list = $gmail->users_messages->listUsersMessages('me', $opt_params);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置