Usually when we are about to compose a big email or a mail which requires pending information, we tend to have them in our drafts. We might update them in bits and pieces and send once it’s done. Some of us might even use drafts feature to keep intact crucial and important information and files. Losing them can be unaffordable!
Consider a situation:
You have Gmail account and have composed a lengthy email which contains important data, which you have collected by putting in hours together of research and analysis. Just when you’re about to send the email say you accidentally click on discard draft. Oops! Once in for all your email is gone for ever. You cannot even find them in your trash. This recently happened to me. Hence I have come with a simple backup plan which should be helpful for everyone.
Meet Gmail Drafts Auto Backup script, which will automatically take a backup of your draft emails and attachments and save them onto Google Drive at regular intervals. So you need not worry about your email being lost because there will always be a backup waiting for you at your Google Drive account. Let’s get started on how to set things up.
How to Auto Save your Gmail Drafts to Google Drive
1. Log-in to your Google Drive account.
2. Make a copy of Gmail Drafts Auto Backup script by clicking here. Then click Yes, make a copy.
3. Now select Authorize from Gmail Drafts Auto Backup menu, next to help. Click OK in the popup then click on Grant access followed up by close.
4. Choose initialize from the menu.
5. Finally choose start Gmail drafts auto backup and wait for a while for the script execution to complete. If everything goes well you will get a success message and initially copy of your drafts and attachments will be saved inside folder named Gmail Draft Backup in Google Drive. Similarly if you want to stop the backup from being created, select stop option from the menu.
Now on,the script will be running in background and taking backups every one hour. Existing copies will be removed and replaced with newer ones.
Note: Due to Google resource quota limitations there are chance for the script to fail in-case you have lots of emails in your drafts.
This script is improvisation of Marcello Scacchetti’s original work.
So, did you like the script ? Have you ever found yourself in a bad situation of losing your important drafts ? Have any suggestion or queries ? Feel free to drop in your views.
I Can’t find “Gmail Drafts Auto Backup menu”,tab in docs tabs ..
3. Now select Authorize from “Gmail Drafts Auto Backup menu”, next to help. Click OK in the popup then click on Grant access followed up by close.
Please help
Charles,
Wait for a while for the menu to load or manually trigger it by going to Tools-> Script Editor ->Run and click on onOpen. Now you should be seeing the menu in your sheet.
Must say, a great utility to save the drafts from getting deleted accidentally.
BUT, imagine a scenario where the drafts got deleted accidentally and that is the EXACT time of the hour when this script is updating the notes. So, one might still not be able to recover it especially if he delays the process of recovering the deleted draft by few minutes.
Shouldn’t the utility also have option of back up time? e.g. Back up every 1 hour, Back up every 24 hours etc? This will minimize the probability of event I described above
Harish,
Thanks. The script already runs every one hour and executes the backup job. That’s how it was designed 🙂
Ok, I wasn’t very clear on my suggestion!
I know it runs every hour and takes backup. That’s why I wrote that if draft gets deleted and that minute if the script takes backup (which means the deleted draft will not be backed up) then we will not recover that draft.
What I meant was instead of JUST one option of having backup every one hour (which means that in above scenario, the draft may not be recovered), how about having more options eg back up every 24 hours, back up every 1 week. This might also be better on data usage point of view in case someone has many old drafts with attachments.
Ya got you. It’s possible to have those options but requires bit of code change.
But I see there is no need for that because running every hour increases the case of better backup because if every 24 hours it’s just going to run once in a day but if it’s every 1 hour it’s going to run 24 times in a day(all days in a week too) hence greater the chances.
Hope you got me..
Ok Thanks.
Query: Does this script run in my gmail id in the background? Means, do I need to have my laptop or device turned on for the script to be taking backup?
No you need not turn on, after setup it runs in your Google account in background. So no worries 🙂
Message details
ReferenceError: “DocsList” is not defined.
Will be pushing a fix over this weekend. Thanks for letting me know!
This has been fixed. Thanks!
Getting the same error as mike.
This as been fixed. Please try now. Thanks!
Hi there,
After running the script, I see quite a few drafts are backed-up, but got this “Exceeded maximum execution time”, It has not backed-up all my drafts.
Any help in this regards would be appreciated.
Also does the script read/forward any personal user data from gmail?
Probably you have lot of attachments. No the script does not forward anything.
Hello, I would like to be able to DISABLE.. but i dont want to throw away. Could you please tell me how i can do that?
I want to study the code. But it doesnt work for me.. and every hour i get an email from google telling me it failed.
I dont have time to figure out why.. I dont want to throw away.. I just want to put it on hole for a bit until i can get back to it..
Thanks for any help you may offer.
Dennis
Thank you for this tool! I have had the issue where I accidentally deleted drafts of important emails.
One request though: is it possible to set up the script, or create a different version of it, that checks more frequently, but only backs up the past 30 minutes or so of drafts? Because that’s really the issue for me, when I lose a long email that I’m working on.
Many thanks, and have a happy new year!
Can you increase the max execution time to a few more mins? it backups up 70% of my drafts and errors out
This is a useful script. However, after backing up maybe 30 drafts, the script stops because it exceeded the maximum execution time. I do have about 2000 drafts, but since it stops after so few, I am not sure it is due to that.