gsuite-smtp - Package to allow sending emails through Google Suite or even Gmail, without turning on the "allow less secure apps" and using OAuth2.0 token, client id, client secret and refresh token
epiphany-infotech/gsuite-smtp is a Laravel package for gsuite-smtp - package to allow sending emails through google suite or even gmail, without turning on the "allow less secure apps" and using oauth2.0 token, client id, client secret and refresh token.
It currently has 0 GitHub stars and 14 downloads on Packagist (latest version 1.0.2).
Install it with composer require epiphany-infotech/gsuite-smtp.
Discover more Laravel packages by epiphany-infotech
or browse all Laravel packages to compare alternatives.
Last updated
Package to allow sending emails through Google Suite or even Gmail, without turning on the "allow less secure apps" and using OAuth2.0 token, client id, client secret and refresh token
Tested on Laravel 6.x
Before installing, it is assumed that you have created the App on Google and have the:
If you don't have the refresh token or need to know more about getting these details, start from here: https://developers.google.com/google-ads/api/docs/first-call/refresh-token#php
Once you have these:
composer require epiphany-infotech/gsuite-smtp
config\app.php file:EpiphanyInfotech\GSuiteSMTP\GSuiteSMTPServiceProvider::class,
php artisan vendor:publish --tag=gsuiteconfig
ENABLE_GSUITESMTP=true
SMTP_USER_EMAIL=youremail@tld.com
SMTP_REFRESH_TOKEN="your referesh token" #preferred to be in quotes
SMTP_CLIENT_SECRET="your client secret" #preferred to be in quotes
SMTP_CLIENT_ID="your client id" #preferred to be in quotes
Delete the cached files present in bootstrap\cache. No need to delete the .gitignore file.
Run the coommands:
php artisan config:cache
php artsian config:clear
This should get you going and you shouldn't have to enable "allow less secure apps" just to have the SMTP working
Points to keep in mind:
.env should remain as it would be without this package, i.e.: MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=youremail@tld.com
MAIL_PASSWORD=NULL #Can be anything but since we are bypassing it, it's just mentioned as null
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=youremail@tld.com
MAIL_FROM_NAME="${APP_NAME}"
Contributors are welcomed to work further on this project. Remove flaws, add documentation or more features, more smtp providers etc.
For any inquires regarding a new Laravel Project or any web or mobile development related work, please visit:
https://www.epiphanyinfotech.com
Or email at: