手机赌博app

网投担保网站打牌运气不好怎么办-亿操盘

网投担保网站天天好运来提现-人人配资

How to Factory Reset your Gmail Account

H
Published in: Gmail - Google Apps Script

your phone, the ipad, and your laptop offer a ‘hard reset’ option that resets your device to the default factory settings. once you perform a factory reset, it erases all the apps, files, and settings and there’s no way to recover the wiped off data.

Nuke Gmail Account - Remove Everything

What is Gmail Factory Reset

if you ever need to “factory reset” an old gmail account that you no longer use, and start afresh with a clean slate, google scripts can help. the script will perform a series of tasks to completely reset your gmail account:

  1. Delete all Gmail labels
  2. Delete all Gmail filters
  3. Delete all Draft messages
  4. Delete all email messages in Gmail
  5. Delete all spam messages
  6. Permanently empty your Gmail trash folder
  7. Remove Out-of-Office message
  8. Disables POP and IMAP
  9. Remove all email signatures in Gmail
  10. Stops all email forwarding

⚠️ Warning: Danger Ahead

Before you proceed, please understand that hard reset is an irreversible process手机赌博app and you will not be able to recover your Gmail data after the reset is complete.

the google script is available on or you can to make a copy of the script in your google account. the script uses the official gmail api to format your gmail account.

Remove all Gmail Labels

const deleteGmailLabels = () => {
  GmailApp.getUserLabels().forEach((label) => {
    label.deleteLabel();
  });
};

Remove all Gmail Filters

const deleteGmailFilters = () => {
  const { filter: gmailFilters } = Gmail.Users.Settings.Filters.list('me');
  gmailFilters.forEach(({ id }) => {
    Gmail.Users.Settings.Filters.remove('me', id);
  });
};

Remove all Gmail Drafts

const deleteGmailDrafts = () => {
  GmailApp.getDrafts().forEach((draft) => {
    draft.deleteDraft();
  });
};

Reset Gmail Settings

turn off vacation autoresponders, disables imap and pop access, removes all email signatures and disables email forwarding.

const resetGmailSettings = () => {
  const { Settings } = Gmail.Users;
  // Disable Out-of-office
  Settings.updateVacation({ enableAutoReply: false }, 'me');

  // Delete Gmail Signatures
  const { sendAs } = Settings.SendAs.list('me');
  sendAs.forEach(({ sendAsEmail }) => {
    Settings.SendAs.update({ signature: '' }, 'me', sendAsEmail);
  });

  // Disable IMAP
  Settings.updateImap({ enabled: false }, 'me');

  // Disable POP
  Settings.updatePop({ accessWindow: 'disabled' }, 'me');

  // Disable Auto Forwarding
  const { forwardingAddresses } = Settings.ForwardingAddresses.list('me');
  forwardingAddresses.forEach(({ forwardingEmail }) => {
    Settings.ForwardingAddresses.remove('me', forwardingEmail);
  });
};

Delete all Gmail Messages

this will move all inbox messages, archived message, and spam to the trash folder. google scripts can execute for 5 minutes in one batch so we added a check to stop the script if it is taking longer to complete.

const startTime = Date.now();
const isTimeLeft = () => {
  const ONE_SECOND = 1000;
  const MAX_EXECUTION_TIME = ONE_SECOND * 60 * 5;
  return MAX_EXECUTION_TIME > Date.now() - startTime;
};

/**
 * Move all Gmail threads to trash folder
 */
const deleteGmailThreads = () => {
  let threads = [];
  do {
    threads = GmailApp.search('in:all', 0, 100);
    if (threads.length > 0) {
      GmailApp.moveThreadsToTrash(threads);
      Utilities.sleep(1000);
    }
  } while (threads.length && isTimeLeft());
};

/**
 * Move all Spam email messages to the Gmail Recyle bin
 */
const deleteSpamEmails = () => {
  let threads = [];
  do {
    threads = GmailApp.getSpamThreads(0, 10);
    if (threads.length > 0) {
      GmailApp.moveThreadsToTrash(threads);
      Utilities.sleep(1000);
    }
  } while (threads.length && isTimeLeft());
};

Permanently Empty the Trash Folder

/**
 * Permanetly empty the Trash folder
 */
const emptyGmailTrash = () => {
  let threads = [];
  do {
    threads = GmailApp.getTrashThreads(0, 100);
    threads.forEach((thread) => {
      Gmail.Users.Threads.remove('me', thread.getId());
    });
  } while (threads.length && isTimeLeft());
};

also see:

Published in: Gmail - Google Apps Script

looking for something? find here!

网投担保网站去湘西凤凰古城攻略-新立方

手机赌博appmeet the author

Web Geek, Tech Columnist
A
Amit Agarwal

Amit Agarwal手机赌博app is a Google Developer Expert in GSuite and Google Apps Script. He holds an engineering degree in Computer Science (I.I.T.) and is the first professional blogger in India. Read more on  and 

Get in touch
  • Send an email at
  • Follow on and .
  • Subscribe to our and never miss an update.
567棋牌 牛牛游戏app下载 588棋牌