Fitur mengirim email pada Laravel dengan Gmail atau Google Suite / G Suite
Konfigurasi yang dilakukan jika menggunakan gmail dan g-suite untuk mengirim email melalui laravel itu berbeda.
1. Dengan akun Gmail free biasa emailsaya@gmail.com
Dengan mengikuti panduan artikel berikut: https://medium.com/@agavitalis/how-to-send-an-email-in-laravel-using-gmail-smtp-server-53d962f01a0c
2. Dengan akun Google Suite atau G suite
Mengikuti panduan pada stackoverflow ini:
Berikut ini jawabannya:
I researched on the internet and some answers includes enabling the “access for lesser app” and “unlocking gmail captcha” which sadly didn’t work for me until I found the 2-step verification.
What I did the following was:
- enable the 2-step verification to google HERE
- Create App Password to be use by your system HERE
- I selected Others (custom name) and clicked generate
- Went to my env file in laravel and edited this
MAIL_USERNAME=talentscoutphil@gmail.com
MAIL_PASSWORD=thepasswordgenerated
5. Restarted my apache server and boom! It works again.
This was my solution. I created this to at least make other people not go wasting their time researching for a possible answer.
Sekian, semoga bermanfaat, khususnya untuk arsip knowledge penulis pribadi.