第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何在Laravel 5.1中使用gmail發(fā)送郵件?

如何在Laravel 5.1中使用gmail發(fā)送郵件?

PHP
元芳怎么了 2019-10-26 12:25:40
我一次又一次嘗試測試從本地主機發(fā)送電子郵件,但我仍然不能。我不知道該怎么做。我嘗試搜索以找到解決方案,但找不到。我編輯了config / mail.php:<?phpreturn [    /*    |--------------------------------------------------------------------------    | Mail Driver    |--------------------------------------------------------------------------    |    | Laravel supports both SMTP and PHP's "mail" function as drivers for the    | sending of e-mail. You may specify which one you're using throughout    | your application here. By default, Laravel is setup for SMTP mail.    |    | Supported: "smtp", "mail", "sendmail", "mailgun", "mandrill", "ses", "log"    |    */    'driver' => env('MAIL_DRIVER', 'smtp'),    /*    |--------------------------------------------------------------------------    | SMTP Host Address    |--------------------------------------------------------------------------    |    | Here you may provide the host address of the SMTP server used by your    | applications. A default option is provided that is compatible with    | the Mailgun mail service which will provide reliable deliveries.    |    */    'host' => env('MAIL_HOST', 'smtp.gmail.com'),    /*    |--------------------------------------------------------------------------    | SMTP Host Port    |--------------------------------------------------------------------------    |    | This is the SMTP port used by your application to deliver e-mails to    | users of the application. Like the host we have set this value to    | stay compatible with the Mailgun e-mail application by default.    |    */    'port' => env('MAIL_PORT', 587),];`
查看完整描述

3 回答

?
互換的青春

TA貢獻1797條經驗 獲得超6個贊

首先登錄到您的gmail帳戶,并在My account > Sign In And Security > Sign In to google,下啟用two step verification,然后可以生成app password,然后可以在.env文件中使用該應用密碼。


您的.env文件將如下所示


MAIL_DRIVER=smtp

MAIL_HOST=smtp.gmail.com

MAIL_PORT=587

MAIL_USERNAME=myemail@gmail.com

MAIL_PASSWORD=apppassword

MAIL_ENCRYPTION=tls

php artisan config:cache在.env文件中進行更改后,請不要忘記運行。


查看完整回答
反對 回復 2019-10-26
  • 3 回答
  • 0 關注
  • 1012 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號