【问题标题】:How to send message to a specific user by using gmail Api如何使用 gmail Api 向特定用户发送消息
【发布时间】:2015-11-19 03:03:52
【问题描述】:

为了首先发送 gmail 消息,我创建了一个草稿然后发送它。我成功创建了草稿,但我找不到指定 To 参数(此消息将发送给谁)的方法

请帮帮我。

【问题讨论】:

    标签: php gmail-api


    【解决方案1】:

    将收件人放在 To、Cc 或 Bcc 标头中。

    【讨论】:

    • 你能告诉我一个将收件人放在 To 标题中的示例吗?我的代码如下所示:
    • $message = new Google_Service_Gmail_Message(); $message->setRaw(base64_encode($text)); $draft = new Google_Service_Gmail_Draft(); $draft->setMessage($message);试试 { $draft = $service->users_drafts->create($profile->username, $draft); $service->users_drafts->send($profile->username, $draft); } catch (Exception $e) { print '发生错误:' . $e->getMessage(); }
    • @GlobalEnterprise 改用代码编辑您的问题。
    • 我正在尝试使用 gmail api 回复消息。你能给我举个例子吗?
    猜你喜欢
    • 2014-08-14
    • 2015-04-27
    • 1970-01-01
    • 2019-07-24
    • 1970-01-01
    • 2017-01-13
    • 1970-01-01
    相关资源
    最近更新 更多