Recommend this page to a friend! |
Download .zip |
Info | Documentation | View files (7) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2024-04-15 (Yesterday) | Not yet rated by the users | Total: Not yet counted | Not yet ranked |
Version | License | PHP version | Categories | |||
laravel-gmail-oauth2 1.0 | Custom (specified... | 7 | Email, Networking, Libraries, PHP 7 |
Description | Author | |
This package can send messages via Gmail SMTP server using OAuth. |
Install the package using composer as described in the README file.
Then, follow steps 1 and 2, depending on the version of Laravel you are using, to configure the package.
This Laravel package allows you to send emails securely using Gmail OAuth2 credentials, eliminating the need to store sensitive information like username and password in your application configuration.
This package is actively maintained and free to use. If you find it helpful, consider giving back by:
You can install the package via composer:
For PHP 8 and Laravel 9:
composer require iagofelicio/laravel-gmail-oauth2
For PHP 7 and Laravel 7/8:
composer require iagofelicio/laravel-gmail-oauth2:1.0.4
To obtain a Gmail OAuth2 refresh token, you can refer to the instructions provided by the PHPMailer package on Github https://github.com/PHPMailer.
For detailed instructions on generating a Gmail OAuth2 refresh token, we recommend following the excellent tutorial provided by Coding Yet https://www.codingyet.com/how-to-use-phpmailer-with-xoauth2/.
This tutorial walks you through the process step-by-step, ensuring a smooth setup for your secure email sending.
Edit config/mail.php
adding the following line:
return [
'driver' => 'gmail',
// Default code ...
];
Edit config/mail.php
adding the following mailer:
return [
'mailers' => [
// Default code ...
'gmail' => [
'transport' => 'gmail',
],
]
];
Edit the MAIL_MAILER in .env
file:
MAIL_MAILER=gmail
Add your Gmail credentials in .env
file:
GMAIL_API_CLIENT_ID="your-api-client-id"
GMAIL_API_CLIENT_SECRET="your-api-client-secret"
GMAIL_API_CLIENT_REFRESH_TOKEN="your-api-client-refresh-token"
GMAIL_API_CLIENT_MAIL="your-api-client-email"
# Suggested default settings to include
MAIL_FROM_ADDRESS="from@mail.com"
MAIL_FROM_NAME="${APP_NAME}"
Pending development.
composer test
Please see CHANGELOG for more information on what has changed recently.
The MIT License (MIT). Please see License File for more information.
Files |
File | Role | Description | ||
---|---|---|---|---|
src (2 directories) | ||||
CHANGELOG.md | Data | Auxiliary data | ||
composer.json | Data | Auxiliary data | ||
composer.lock | Data | Auxiliary data | ||
LICENSE | Lic. | License text | ||
README.md | Doc. | Documentation |
Version Control | Unique User Downloads | |||||||
100% |
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.