Laravel Password Reset

This post will help you resolve the Laravel error thats returned when a use clicks on the reset password link. ERROR: “Expected response code 250 but got code “530”, with message “530 5.7.1 Authentication required”

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

  1. From your CLI, run: composer require guzzlehttp/guzzle
  2. In the config/mail.php file: 'driver' => env('MAIL_DRIVER', 'mailgun'),
  3. In the .env file: MAILGUN_DRIVER=mailgun
  4. Sign up for an account at mailgun.com
  5. Once signed up go to domains->Add New Domain
  6. Follow the steps listed on Mailgun to verify your domain
  7. 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 just mailgun
  8. 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
  9. 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');
        });
    });
  10. Go test yourdomain.com/test-email
  11. Check your inbox!

References:
Laravel
Dev Dojo