【问题标题】:using gmail send message api with uploadType=resumable使用带有 uploadType=resumable 的 gmail 发送消息 api
【发布时间】:2017-06-29 07:32:13
【问题描述】:

我需要使用带有 gmail python 客户端 api 的可恢复上传类型发送带有大附件的电子邮件。

谷歌驱动器的客户端支持此模式,如下所述: uploading files to gdrive

google-api-python-client 是否支持此选项以在 gmail 中发送消息,或者我是否需要按照此处所述实现它:send message with resumable upload

【问题讨论】:

    标签: google-api-python-client


    【解决方案1】:

    为了使用 google-api-python-client 发送带有大附件的电子邮件,请执行以下操作:

    按照here 的描述创建消息对象,但不是对消息进行编码,而是将消息写入文件并使用 send_message api,如下所示:

        message = (service.users().messages().send(userId=user_id, body=None, media_body=file_name)
               .execute())
    

    【讨论】:

    • 你能举个例子吗?
    猜你喜欢
    • 2014-10-13
    • 2017-03-03
    • 1970-01-01
    • 1970-01-01
    • 2019-08-11
    • 2020-07-12
    • 1970-01-01
    • 2016-12-31
    • 2016-11-29
    相关资源
    最近更新 更多