tiwariswapnil / gmail-api-java

A project to read emails from Gmail using Gmail Oauth2.0 APIs. It can be used for Email Automation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GoogleGmailAPI

A project to read emails from Gmail using Gmail Oauth2.0 APIs. It can be used for Email Automation.

Prerequisites

  1. Enable Gmail API for your account - Refer to link
  2. Create OAuth credentials for your project - Refer to link

Select Desktop App as the Application type for creating the credentials-

Credentials-DesktopApp


  1. Download the credentials json file

DownloadCredentials


  1. And place it in your src/test/resources folder

Refer to https://developers.google.com/gmail/api/quickstart/java for the code.

Tests Execution

  • 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

About

A project to read emails from Gmail using Gmail Oauth2.0 APIs. It can be used for Email Automation.


Languages

Language:Java 100.0%