我正在使用我的Gmail帐户并smtp.gmail.com在我的网络应用程序中测试和发送电子邮件.当我的Gmail帐户启用双因素身份验证时,它无法发送电子邮件,但是当我关闭我的Gmail帐户的双因素身份验证时,该网络应用程序会成功发送电子邮件.感谢任何建议.
我一次又一次地尝试测试从localhost发送电子邮件,但我仍然不能.我不知道该怎么办.我尝试搜索找到解决方案,但我找不到一个.我编辑了config/mail.php:
<?php
return [
/*
|--------------------------------------------------------------------------
| 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 …Run Code Online (Sandbox Code Playgroud)