我的laravel网站出现错误。在我的本地主机中运行,但是在我的服务器中错误 这是我的环境
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_ENCRYPTION=tls
这是我的mail.php
'driver' => env('MAIL_DRIVER', 'smtp'),
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'port' => env('MAIL_PORT', 587),
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
'name' => env('MAIL_FROM_NAME', 'Example'),
],
'encryption' => env('MAIL_ENCRYPTION', 'tsl'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'markdown' => [
'theme' => 'default',
'paths' => [
resource_path('views/vendor/mail'),
],
],
];
昨天运行了smtp,但知道它是错误的 我必须遵循example 但仍然错误。我必须设置我的gmail并更改我的gmail,但仍然无法正常工作
答案 0 :(得分:0)
change MAIL_DRIVER=smtp to MAIL_DRIVER=sendmail in ".env" and 'mail.php' file
之后,运行下面的代码
php artisan cache:clear;
php artisan config:cache;