Download the PHP package ad5jp/laravel-gmail without Composer
On this page you can find all versions of the php package ad5jp/laravel-gmail. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-gmail
Laravel Mailer for Gmail API
This package allows you to use the Gmail API as a mailer in Laravel. You can send emails from Laravel via the Gmail API without modifying your existing code.
Instead of using OAuth, this package uses a service account for sending emails. This eliminates the need for user authentication processes and access token management, while ensuring the method does not fall under LSA (Less Secure Apps).
日本語はこちら
Installation
Specify the version according to your environment:
- v4.x ... Laravel 9 and later
- v3.x ... Laravel 7 - 8
- v2.x ... Laravel 6 and earlier
- v1.x ... Laravel 6 and earlier with google/apiclient-service before v0.200.0
Usage
1. Create a Service Account on Google Cloud Platform
- Create a project in the Google Cloud Platform console.
- Enable the Gmail API.
- Create a service account, generate a key, and download it in JSON format.
- In the Google Workspace admin console, set up "Domain-wide Delegation". Assign the scope
https://www.googleapis.com/auth/gmail.send
to the service account created above.
2. Place the Key
Place the JSON key downloaded in step 2 within your application. Ensure it is excluded from source control using .gitignore or similar.
3. Configure .env
Change the value of MAIL_MAILER
in your .env file to gmail
. (Or change the 'default' value in config/mail.php)
For Laravel 6 and earlier, change the value of MAIL_DRIVER
in your .env file to gmail
. (Or change the 'driver' value in config/mail.php)
Add the following lines to your .env file:
The sender's email address must be an email address within the Google Workspace organization set up in step 1 (4).
All versions of laravel-gmail with dependencies
laravel/framework Version ^6.0
google/apiclient Version ^2.0
google/apiclient-services Version >=0.200.0