【发布时间】:2016-04-24 17:43:54
【问题描述】:
忘记密码,laravel 发送电子邮件,错误如下:
Swift_TransportException in AbstractSmtpTransport.php line 162:
没有发件人地址无法发送消息
我已经在.env 和mail.php 中设置了我的邮件帐户详细信息。
我的 .env :
MAIL_DRIVER=smtp
MAIL_HOST=smtp-mail.outlook.com
MAIL_PORT=587
MAIL_USERNAME=raval_himanshu@live.in
MAIL_PASSWORD=pass
MAIL_ENCRYPTION=tls
我的 mail.php 是
<?php
return [
'driver' => env('MAIL_DRIVER', 'smtp'),
'host' => env('MAIL_HOST', 'smtp-mail.outlook.com'),
'port' => env('MAIL_PORT', 587),
'from' => ['raval_himanshu@live.in' => null, 'Himanshu Raval' => null],
/*
|--------------------------------------------------------------------------
| E-Mail Encryption Protocol
|--------------------------------------------------------------------------
|
| Here you may specify the encryption protocol that should be used when
| the application send e-mail messages. A sensible default using the
| transport layer security protocol should provide great security.
|
*/
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
/*
|--------------------------------------------------------------------------
| SMTP Server Username
|--------------------------------------------------------------------------
|
| If your SMTP server requires a username for authentication, you should
| set it here. This will get used to authenticate with your server on
| connection. You may also set the "password" value below this one.
|
*/
'username' => env('raval_himanshu@live.in'),
'sendmail' => '/usr/sbin/sendmail -bs',
];
我也尝试过php artisan config:cache,但之后它给出了同样的错误。
【问题讨论】:
-
对不起我做错了!!
标签: php laravel laravel-5.2 swiftmailer