Created
June 30, 2021 11:09
-
-
Save jack2jm/742b928e8ccd02a8802f9ca4412bcecd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1. first login to your gmail account. | |
| 2. under Manage account > Sign In And Security > Sign In to google. | |
| 3. enable two step verification. | |
| 4. then you can generate app password. | |
| 5. you can use that app password in .env file. | |
| ---------------------------------------------- | |
| MAIL_DRIVER=smtp | |
| MAIL_HOST=smtp.gmail.com | |
| MAIL_PORT=587 | |
| [email protected] | |
| MAIL_PASSWORD=generate_app_password_from_security | |
| MAIL_ENCRYPTION=tls | |
| MAIL_FROM_ADDRESS=sender_email_name | |
| ------------------------------------------------ | |
| Route::get('/test-email', function () { | |
| try{ | |
| Mail::raw('Test Email!', function($message) { | |
| $message->to('sent_to_email_id')->subject('Testing mails'); | |
| }); | |
| echo "Sent..."; | |
| }catch(Exception $e){ | |
| echo $e->getMessage(); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment