How to get subject of email from gmail using googl

2019-06-21 04:47发布

How to get the subject of a message using Gmail API using python?

1条回答
一纸荒年 Trace。
2楼-- · 2019-06-21 05:11

Users.messages: list returns a list of messages. Each message is a Users.messages resource

Pay load header contains subject

  "payload": {
    "partId": string,
    "mimeType": string,
    "filename": string,
    "headers": [
      {
        "name": string,
        "value": string
      }
    ],

payload.headers[] list List of headers on this message part. For the top-level message part, representing the entire message payload, it will contain the standard RFC 2822 email headers such as To, From, and Subject.

There is python code on the google developer site which will help you get started python quickstart

查看更多
登录 后发表回答