An email extractor made with Python, which uses Gmail API to fetch email ids from the SENT emails in the GMAIL account of the user with a given title.
Run the following command to install the dependencies.
pip3 install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib
-
Create a Google Cloud Project and enable GMAIL API.
-
Create the OAuth credentials. Follow this.
-
Download
credentials.json
and paste the file in the same folder as this folder. -
Run the program using the following command.
python3 extractor.py
-
If running for the first time, you may need to set the redirect URI and login to your GMAIL account.
-
Enter the message title to search and press
Enter
. -
The list of emails will be saved in the current working directory with the name
emails.txt
. The emails, their labels, and snippets can be viewed indata.csv