【问题标题】:How to send email to people via Google Plus API?如何通过 Google Plus API 向人们发送电子邮件?
【发布时间】:2015-05-08 00:34:04
【问题描述】:

根据 Google Plus,您可以向您圈子内的 Google Plus 用户发送电子邮件:refer this

  • 如果您有用户 ID,如何使用 Google Plus API(或 Gmail API)向您圈子中的用户发送电子邮件?
  • 如果您不能这样做,如何通过环聊向他们发送消息?

【问题讨论】:

  • 根据文章,您基本上可以通过姓名搜索任何 Google 用户,而无需通过 Google Plus、邮件或其他 Google 应用程序实际知道他们的姓名。您能否更清楚地了解来自哪个外部应用程序您是否要发送邮件(需要相应地进行 Google API 集成)?

标签: gmail google-plus hangout


【解决方案1】:

您应该遵循官方的 Gmail API 参考指南here

来自文档:

使用 Gmail API 发送电子邮件的方法有两种:

电子邮件发送为 message resourceraw 属性中的 base64url 编码字符串。发送电子邮件的高级工作流程是:

以某种方便的方式创建电子邮件内容并将其编码为 base64url 字符串。创建一个新的消息资源并设置它的原始 属性添加到您刚刚创建的 base64url 字符串。致电messages.send, 或者,如果发送草稿,drafts.send 发送消息。

您需要提供以下参数才能通过 API 发送电子邮件:

Args:
    - service: Authorized Gmail API service instance.
    - user_id: User's email address. The special value "me"
               can be used to indicate the authenticated user.
    - message: Message to be sent.

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-04-18
    • 2013-10-30
    • 2014-12-15
    • 2015-08-29
    • 1970-01-01
    • 1970-01-01
    • 2014-10-14
    • 1970-01-01
    相关资源
    最近更新 更多