MailVault lost access to your Gmail because permissions were removed from your Google account. Visit myaccount.google.com/permissions if this was accidental.
A free Gmail exporter that runs entirely inside your Google Account. No cloud setup, no subscriptions, no data leaving Google's servers.
MailVault is a Google Apps Script project that lives inside your own Google Account. It reads your Gmail on request, lets you review and manage the results, then downloads the export directly to your device.
The first time you open the app, Google will ask you to authorize MailVault. You must complete all four steps below โ this only happens once.
MailVault is a Google Apps Script. Before it can read your Gmail, Google requires you to explicitly grant permission. The script runs entirely inside your own Google account — you are authorizing your own script, not a third-party company.
Open the app link above in your browser. A Google popup will appear titled "MailVault (Unverified)" saying:
Click the blue REVIEW PERMISSIONS button to continue.
Google will show a list of signed-in accounts. Select the Google account whose Gmail you want to export from. Make sure it matches the email the app owner added to the access list.
Google shows a safety screen: "Google hasn't verified this app". This is expected — MailVault is a personal script and has not gone through Google's commercial app review process.
The final screen lists every permission MailVault needs. You must click Allow to grant all of them. Without this, the app cannot function.
Takes about 5 minutes. After setup, just open your Web App URL anytime to export emails.
Open script.google.com and sign in with the Gmail account you want to export from.
Click + New project โ rename it to MailVault.
The editor opens with Code.gs by default. Select all โ delete โ paste the Code.gs source below โ Ctrl+S.
Edit the ALLOWED_EMAILS array with the email addresses you want to allow access.
Hover over "Files" in the left sidebar โ click + โ choose HTML โ name it index (no .html extension).
Delete the placeholder โ paste the index.html source below โ Ctrl+S.
Click Deploy โ New deployment โ โ๏ธ gear โ Web app.
Set: Execute as: Me ยท Who has access: Anyone with Google account
Click Deploy โ Authorize โ Allow.
โ Copy the Web App URL โ bookmark it!
Share the Web App URL with anyone you added to ALLOWED_EMAILS.
Anyone NOT on the list will see a styled Access Denied page โ no data is exposed.
โ Done! Open the URL to start exporting.
Open your Web App URL. You'll see a welcome screen with your Google profile, then the app has three steps.
Welcome Screen
When you open the URL, a login/welcome screen appears showing your Google profile photo, name, and email address. Click Enter MailVault to proceed. Users not on the allowed list see a styled Access Denied page instead.
Step 01 โ Date Range
Set a From and To date. Your Gmail address is automatically detected and shown. For a single day, set both dates to the same date.
Step 02 โ Fetch & Manage
Click Fetch Emails to search Gmail. Results appear in a table with four actions per email:
๐ View
Opens a modal with all email fields: Subject, From, To, CC, Date, Labels, Body, Read/Starred status.
โ๏ธ Edit
Opens an editable form. Edits only affect the export โ Gmail is untouched.
๐ Remove
Removes from the export list. Does not delete from Gmail.
๐ Sort
Sort by Newest, Oldest, Subject AโZ, or From AโZ using buttons above the table.
Step 03 โ Export to Device
Choose a format and click Download. Files save directly to your device's Downloads folder:
Follow all three steps to completely remove MailVault. Each step removes a different component.
This stops the script from accessing your Gmail.
1. Go to the URL above and sign in.
2. Find MailVault in the list.
3. Click it โ click Remove Access โ confirm.
This deletes the script code and permanently invalidates the Web App URL.
1. Find your MailVault project.
2. Click the โฎ menu โ Remove โ confirm.
Any CSV, PDF, or TXT files you downloaded live on your own device. Delete them from your Downloads folder manually if needed.
"Script function not found: doGet"
Code.gs was deployed before being saved. Re-paste Code.gs, press Ctrl+S, then create a new deployment version.
"No emails found" for a date you know has emails
Widen the date range by one day in each direction. Gmail's date search can be offset by your timezone.
"Script timeout" error
Google Apps Script has a 6-minute execution limit. Use a shorter date range.
"Access Denied" page appears
Your email is not in the ALLOWED_EMAILS array in Code.gs. Add your email there and redeploy a new version.
Profile photo doesn't appear on welcome screen
The People API may not be enabled. The app falls back to showing your name initials as an avatar โ all other features still work normally.
Both files are below. Click Copy Code on each, then paste into Apps Script.
You've read everything you need to know. Tick each confirmation below, then click the Launch button to open the app.