MIME Headers Not Making it Through Gmail API

前端 未结 2 597
花落未央
花落未央 2020-12-06 19:12

I\'m trying to automate the creation of drafts via the Gmail API, and I want these drafts to be responses to existing emails. To do this, I believe I need to set the \"threa

2条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-06 19:37

    if you want to not only create the draft but also additionally send it then extension of above code (one additional line after draft =...create().execute():

        draft = service.users().drafts().create(userId="me", body= message).execute()
        message = service.users().drafts().send(userId='me', body={'id': draft['id']}).execute()
    

提交回复
热议问题