如何通过Google Plus API向人们发送电子邮件?

Wil*_*Hua 13 gmail google-plus hangout

根据Google Plus的说法,您可以通过电子邮件发送圈子中的Google Plus用户:请参阅此处

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

LS_*_*LS_ 6

您应该遵循此处的官方Gmail API参考指南.

来自文档:

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

电子邮件在消息资源raw属性中作为base64url编码的字符串发送.发送电子邮件的高级工作流程是:

以某种方便的方式创建电子邮件内容,并将其编码为base64url字符串.创建一个新的消息资源并将其raw属性设置为刚刚创建的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.
Run Code Online (Sandbox Code Playgroud)