Deletes email threads from Gmail
- Create a new Google Cloud Platform project and:
- enable the Gmail API
- configure your OAuth consent screen
- add the
https://mail.google.com/scope to your allowed scopes list
You can also use the Gmail API Quickstart guide (click on ENABLE THE GMAIL API): https://developers.google.com/gmail/api/quickstart/php
- Create OAuth Client ID credentials
If you used the Quickstart guide, they will generate them for you.
-
Download your credentials JSON and save them to
auth/credentials.json -
Run
composer install -
Run
php deleteTrash.phpand walk through the authorization process -
Watch email threads disappear from your Trash folder