我尝试在laravel 5上创建一个密码重置系统,这就是我所做的:
1。 Route.php
Route::get('/password/email','Auth\PasswordController@getEmail');
Route::post('/password/email','Auth\PasswordController@postEmail');
Route::get('/password/reset/{token}','Auth\PasswordController@getReset');
Route::post('/password/reset','Auth\PasswordController@postReset');
2。 .env文件
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mandrillapp.com
MAIL_PORT=587
MAIL_USERNAME=*****@gmail.com
MAIL_PASSWORD=********
第3。 composer.json
...
"require": {
....
....
"guzzlehttp/guzzle": "~5.0"
},
...
4。 mail.php
<?php
return [
'driver' => env('MAIL_DRIVER', 'smtp'),
'host' => env('MAIL_HOST', 'smtp.mandrillapp.com'),
'port' => env('MAIL_PORT', 587),
'from' => ['address' => "****@gmail.com", 'name' => "****"],
'encryption' => 'tls',
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'sendmail' => '/usr/sbin/sendmail -bs',
'pretend' => false,
];
答案 0 :(得分:0)
尝试使用mandrill驱动程序
在config / services.php中添加密钥,并将.env中的邮件驱动程序更改为mandrill