如何使用python使用Google API从gmail获取电子邮件主题? [英] How to get subject of email from gmail using google API using python?

查看:172
本文介绍了如何使用python使用Google API从gmail获取电子邮件主题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用Python使用Gmail API获取邮件的主题?

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

推荐答案

Users.messages:list 返回消息列表。每封邮件都是 Users.messages 资源

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

有效负载标头包含主题

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




payload.headers []列表此消息部分上的标头列表。对于代表整个消息有效负载的顶级消息部分,它将包含标准的RFC 2822电子邮件标头,例如To,From和Subject。

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.

Google开发人员网站上有python代码,可帮助您入门 python快速入门

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

这篇关于如何使用python使用Google API从gmail获取电子邮件主题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆