[英]Swift_TransportException Cannot send message without a sender address
everyone.每个人。
I use laravel6(v6.18.2), and run php artisan serve
我使用 laravel6(v6.18.2),并运行
php artisan serve
I tried to send an email with Laravel's default user Authentication.我尝试使用 Laravel 的默认用户身份验证发送电子邮件。 But it gave an error
Swift_TransportException Cannot send message without a sender address
但它给出了一个错误
Swift_TransportException Cannot send message without a sender address
Here is my code :这是我的代码:
//.env
MAIL_DRIVER=smtp
MAIL_HOST=smtp.zoho.com
MAIL_PORT=587
MAIL_USERNAME=blabla
MAIL_PASSWORD=blabla
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=blabla@xxx.xxx
MAIL_FROM_NAME="${APP_NAME}"
//config/mail.php
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
'name' => env('MAIL_FROM_NAME', 'Example'),
],
Could anyone please tell me why?谁能告诉我为什么? Thank you.
谢谢你。
Clear Cache in Laravel (Terminal)清除 Laravel 中的缓存(终端)
Log in to the system running your Laravel application and open a terminal.登录到运行 Laravel 应用程序的系统并打开一个终端。 Then navigate to your Laravel application code.
然后导航到您的 Laravel 应用程序代码。 Here you can issue the commands to clear cache as followings:
您可以在此处发出清除缓存的命令,如下所示:
Clear Application Cache清除应用程序缓存
Clear Route Cache清除路由缓存
Clear Configuration Cache清除配置缓存
Clear Compiled Views Cache清除编译视图缓存
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.