A project to read emails from Gmail using Gmail Oauth2.0 APIs. It can be used for Email Automation.
- Enable Gmail API for your account - Refer to link
- Create OAuth credentials for your project - Refer to link
Select Desktop App as the Application type for creating the credentials-
- Download the credentials json file
- And place it in your src/test/resources folder
Refer to https://developers.google.com/gmail/api/quickstart/java for the code.
- After cloning the project, compile using the IDE Maven plugin or
mvn clean compile
- Tests can be run by any of following ways:
- Command line using
mvn clean test
from project root directory - Run (green play) button in Test class -
/src/test/java/com/github/emailautomation/test/EmailTest.java
- Command line using