Michael Michael - 2 years ago 321
PHP Question

Laravel 5 Password Reset Email Not Being Sent

I am trying to implement a password reset on my Laravel 5.1 app. I have followed the docs (http://laravel.com/docs/5.1/authentication#resetting-passwords) to get this working. However whenever I click on my 'reset password' button on my

no email is ever sent.

I have intentionally entered incorrect emails and I am getting the appropriate error however when I enter a correct email no email is sent and I get no type of message or any emails.

I have looked at my database and it does looks as though a password reset token being created, just no email is sent.

My email configuration is working properly as other parts of my application sends email properly, only this one section is not sending the emails. Any help will be appreciated as I do not what else to check.



// Password reset link request routes...
Route::get('password/email', ['as' => 'password/email', 'uses' => 'Auth\PasswordController@getEmail']);
Route::post('password/email', 'Auth\PasswordController@postEmail');

// Password reset routes...
Route::get('password/reset/{token}', 'Auth\PasswordController@getReset');
Route::post('password/reset', 'Auth\PasswordController@postReset');


<form id="contact-form" class="contact-section" method="POST" action="/password/email">
<input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
<span class="pre-input"><i class="fa fa-envelope-o"></i></span>
<input class="name plain buffer" type="email" name="email" placeholder="Email" value="{{ old('email') }}">
<input id="send" class="plain button yellow" type="submit" value="Reset Password">
@foreach($errors->all() as $error)
<font size="3" color="red">{{ $error }}</font>



Click here to reset your password: {{ url('password/reset/'.$token) }}

I have added a Log to the postEmail function.

public function postEmail(Request $request)
$this->validate($request, ['email' => 'required|email']);

$response = Password::sendResetLink($request->only('email'), function (Message $message) {
Log::info('Password Reset Execute -1 '); //Does work here


switch ($response) {

case Password::RESET_LINK_SENT:
return redirect()->back()->with('status', trans($response));

case Password::INVALID_USER:
return redirect()->back()->withErrors(['email' => trans($response)]);

Log::info('Password Reset Execute - 2'); //Will not work here

Answer Source

If the issue is invalid sender, make sure you pass the correct sender

$message->from('hello@app.com', 'Your Application');
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download