Laravel Reset Password Tutorial
Are your users able to “reset password” from within the login page of your Laravel application? Some configuration is needed before this feature will work with Laravel. If you have not configured Laravel for email password recovery, your users will get a 503 Internal Server error on your production server and/or the following error in your development environment: Expected response code 250 but got code “530”, with message “530 5.7.1 Authentication required? Follow these step by step instructions to resolve.
Configuration for this will be implemented with use of Mailgun’s API. You will need to sign up for an account at mailgun.com.
Mailgun Configuration
- From your CLI, run:
composer require guzzlehttp/guzzle
- In the config/mail.php file:
'driver' => env('MAIL_DRIVER', 'mailgun'),
- In the .env file:
MAILGUN_DRIVER=mailgun
- Sign up for an account at mailgun.com
- Once signed up go to domains->Add New Domain
- Follow the steps listed on Mailgun to verify your domain
- You may need to change the text record listed in mailgun. For example, mailgun lists the text record hostname as being:
mailgun.yourdomain.com
but Godaddy requires justmailgun
- In you .env file:
MAILGUN_HOST=smtp.mailgun.com
MAILGUN_PORT=587
MAILGUN_USERNAME=postmaster@yourdomain.com
MAILGUN_PASSWORD=your_mailgun_default_password
MAILGUN_DOMAIN=mg.yourdomain.com
MAILGUN_SECRET=your_mailgun_api_key - Test email – from within your web.routes file add the route:
Route::get('test-email', function() { Mail::raw('Laravel Test Email!', function($message){ $message->to('yourname@yourdomain.com'); }); });
- Go test yourdomain.com/test-email
- Check your inbox!