I want to know if it's possible to create draft mail using Google Apps script. And if yes, how is it possible ?
Regards, Sebastien
I want to know if it's possible to create draft mail using Google Apps script. And if yes, how is it possible ?
Regards, Sebastien
Google added support for generating drafts in September 2017. From the documentation:
I do this via Zapier now - it's fantastic.
See this zap http://zpr.io/fhmT
Google's documentation on the subject is here:
https://developers.google.com/gmail/api/guides/drafts
No. It is not possible to do so. See the documentation.
At this point in time, there is no way to create a new message that appears in your
Drafts
folder. This functionality has been requested previously - see Issue 985. If you are interested in receiving any updates, visit and star the issue.EDIT: While still not natively supported in Google Apps Script, you can create drafts by using the GMail API, using
getOAuthToken()
to authenticate (introduced Feb 2014). Drafts support was added to the API in June 2014, and an example of its use from GAS is shown in comment 29 of the above issue. Code reproduced here for convenience: