laravel5.2 邮件发送报错Swift_Transport
2016-06-07 本文已影响1118人
sleepingwaly
报错
Swift_TransportException in AbstractSmtpTransport.php line 162: Cannot send message without a sender

问题发现
使用laravel的用户认证系统时,
php artisan make:auth
后自动生成注册和登录视图,以及所有的认证路由,同时生成 HomeController,但是重置密码时/password/reset
发送邮件抛出如题异常。
解决问题
- 看报错字面意思,缺少sender不能发送信息,应该是配置参数的问题
- 确保.env 配置文件中的邮件发送相关配置填写无误
-
config/mail.php
配置文件中第58行'from' => ['address' => null, 'name' => null]
,填写地址和名称即可解决问题
