2017-03-16 14 views
1

私は私のlaravelサイトから電子メールを送信しようとすると、私はこのエラーSwift_TransportException:

Swift_TransportException in StreamBuffer.php line 268: Connection could not be established with host lin01.hkdns.co.za [ #0]

にすべての私の詳細情報を取得するには、右にあります。私のenv

私mail.phpで
MAIL_DRIVER=smtp 
MAIL_HOST=lin01.hkdns.co.za 
MAIL_PORT=465 
[email protected] 
MAIL_PASSWORD=password 
MAIL_ENCRYPTION=ssl 

'driver' => env('MAIL_DRIVER', 'smtp'), 

'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 

'port' => env('MAIL_PORT', 587), 

'from' => [ 
    'address' => env('MAIL_FROM_ADDRESS', '[email protected]'), 
    'name' => env('MAIL_FROM_NAME', 'Info'), 
], 

'encryption' => env('MAIL_ENCRYPTION', 'tls'), 

'username' => env('MAIL_USERNAME'), 
'password' => env('MAIL_PASSWORD'), 

'sendmail' => '/usr/sbin/sendmail -bs', 

'markdown' => [ 
    'theme' => 'default', 

    'paths' => [ 
     resource_path('views/vendor/mail'), 
    ], 
], 

は、私が何かを逃したのか、これは私のサーバー上の問題がありますか?

答えて

0

いつか、ラーベルに「キャッシュ」することは可能です。

このコマンドを使用して、やり直してください:

php artisan config:clear 

動作しない場合は、あなたがXAMPPの再起動してみてください。

問題がホストにあるかどうかを確認する別の方法として、Gmailサーバーを使用してテストメールを送信する方法があります。

は、ストリームバッファでのご.env

MAIL_DRIVER=smtp 
MAIL_HOST=smtp.gmail.com 
MAIL_PORT=587 
[email protected] 
MAIL_PASSWORD=apppassword 
MAIL_ENCRYPTION=tls 

less secure appsより多くの情報を作成するか、または任意のGmailアカウントを使用して有効here

first login to your gmail account and under My account > Sign In And Security > Sign In to google, enable two step verification, then you can generate app password, and you can use that app password in .env file.

Your .env file will then look something like this

MAIL_DRIVER=smtp MAIL_HOST=smtp.gmail.com MAIL_PORT=587 [email protected] MAIL_PASSWORD=apppassword MAIL_ENCRYPTION=tls

Don't forget to run php artisan config:cache after you make changes in your .env file (or restart your server).

ソースhere

+0

私は今、このエラーが出る 'ErrorExceptionでこれを入れます.php 94行目:stream_socket_enable_crypto():コード1でSSL操作が失敗しました。OpenSSLエラーメッセージ: エラー:14090086:SSLルーチン:SSL3_GET_SERVER_CERTIFICATE:証明書の検証に失敗しました。 – Isis

関連する問題