GMAIL API PHP

Description

  • This a php cli app that uses gmail api to send mails.

Installation

git clone https://github.com/jakhax/gmail-api-php.git
composer install

setup

Gmail API creds

  • If you do not have the credentials file, head over to the docs section
  • On step 1 select enable the gmail api then download client configuration
  • Save the file credentials.json in the config dir, dont commit it.

usage

List available commands

./php-gmail list

simple mailer

./php-gmail-api simplegmail\
 --sender=me@mail.com --to=you@mail.com\
 --subject=Hello --body=Hello World!

next steps

  • implement dependency injection using symfony service containers,symfony dependency injection.
  • Add support for batch email.
  • Add gmail service account support.
  • Command for getting recipients and mail from a files(e.g csv file).