# Google Mail SMTP 設定 ## 設定 env 設定權限 ``` cd /var/www; sudo chown kali:kali se_project -R; cd se_project; vim .env; ``` ``` MAIL_DRIVER=smtp MAIL_HOST=smtp.gmail.com MAIL_PORT=587 MAIL_USERNAME=gmail帳號 MAIL_PASSWORD=gmail密碼 MAIL_ENCRYPTION=tls ``` ## 關閉二步驟驗證(如果沒有可以跳過) * [關閉二步驟驗證](https://support.google.com/accounts/answer/1064203?hl=zh-Hant&co=GENIE.Platform%3DDesktop) ## 開啟低安全性應用程式存取 * [低安全性應用程式存取](https://myaccount.google.com/lesssecureapps) ![](https://i.imgur.com/jB9jwaR.png) 以上流程設定完之後,可以使用 信件樣式管理 嘗試發信 ![](https://i.imgur.com/QGkAeIV.png) 最後在 `/var/www/se_project` 輸入以下指令,載入設定即可 ``` cd /var/www/se_project; php artisan config:clear;php artisan view:clear;php artisan route:clear; php artisan cache:clear; php artisan clear; sudo supervisorctl stop laravel-worker:*;sudo supervisorctl reread; sudo supervisorctl update;sudo supervisorctl start laravel-worker:*; cd /var/www; sudo chown www-data:www-data se_project -R; ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up