2017-01-09 53 views
0

我想發送指向郵件地址的鏈接來重置密碼。但它顯示「Swift_TransportException在AbstractSmtpTransport.php線383: 預期響應碼250,但得到的代碼‘530’,與消息‘530 5.7.1需要驗證’Laravel:重置密碼需要進行哪些更改

我.ENV是這樣

MAIL_DRIVER=smtp 
MAIL_HOST=asmtp.unoeuro.com 
MAIL_PORT=587 
[email protected] 
MAIL_PASSWORD=******** 
MAIL_ENCRYPTION=tls 

我reset.blade.php是這樣

<form class="form-horizontal" role="form" method="POST" action="{{ password/reset/, [$token] }}"> 
        {{ csrf_field() }} 

        <!-- <input type="hidden" name="token" value="{{ $token }}"> --> 

        <div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}"> 
         <label for="email" class="col-md-4 control-label">E-Mail Address</label> 

         <div class="col-md-6"> 
          <input id="email" type="email" class="form-control" name="email" value="{{ $email or old('email') }}" required autofocus> 

          @if ($errors->has('email')) 
           <span class="help-block"> 
            <strong>{{ $errors->first('email') }}</strong> 
           </span> 
          @endif 
         </div> 
        </div> 

        <div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}"> 
         <label for="password" class="col-md-4 control-label">Password</label> 

         <div class="col-md-6"> 
          <input id="password" type="password" class="form-control" name="password" required> 

          @if ($errors->has('password')) 
           <span class="help-block"> 
            <strong>{{ $errors->first('password') }}</strong> 
           </span> 
          @endif 
         </div> 
        </div> 

        <div class="form-group{{ $errors->has('password_confirmation') ? ' has-error' : '' }}"> 
         <label for="password-confirm" class="col-md-4 control-label">Confirm Password</label> 
         <div class="col-md-6"> 
          <input id="password-confirm" type="password" class="form-control" name="password_confirmation" required> 

          @if ($errors->has('password_confirmation')) 
           <span class="help-block"> 
            <strong>{{ $errors->first('password_confirmation') }}</strong> 
           </span> 
          @endif 
         </div> 
        </div> 

        <div class="form-group"> 
         <div class="col-md-6 col-md-offset-4"> 
          <button type="submit" class="btn btn-primary"> 
           Reset Password 
          </button> 
         </div> 
        </div> 
       </form> 

我mail.php是這樣

我需要做什麼更改才能發送郵件並重置密碼?

回答

1

我認爲你需要做出正確的MAIL_USERNAMEMAIL_PASSWORD

您可以按照給定的鏈接(Trying to get Laravel 5 email to work)瞭解更多詳情。

希望爲你工作!

UPDATE
請一旦你可以清除緩存:

php artisan cache:clear 
php artisan config:cache 
php artisan cache:clear 
+0

我看到了,但仍然找不到任何解決方案 – incorporeal

+0

我希望您在應用我建議的更改後執行了清除緩存。如果沒有,請參閱*更新*。 –

+0

thnx它的工作。我清除緩存,但沒有做配置:緩存現在它工作正常..thnx – incorporeal

0

就像AddWeb解決方案私人有限公司說,上面清清楚楚地寫着「530 5.7.1需要驗證」這基本上意味着你的郵件憑據不正確。另外,請嘗試查找郵件提供商使用的加密和端口類型。

相關問題