我無法在laravel 5發送一封電子郵件,當我點擊發送返回此消息SSL錯誤Laravel 5.2
ErrorException in StreamBuffer.php line 95:
stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
這裏是我的.ENV文件
MAIL_DRIVER=smtp
MAIL_HOST=smtp-relay.gmail.com
MAIL_PORT=587
MAIL_USERNAME=**********@gmail.com
MAIL_PASSWORD=*********
MAIL_ENCRYPTION=ssl
文件的郵件。 php
return [
'driver' => env('MAIL_DRIVER', 'smtp'),
'host' => env('MAIL_HOST', 'smtp-relay.gmail.comt'),
'port' => env('MAIL_PORT', 587),
'from' => ['address' => null, 'name' => null],
'encryption' => env('MAIL_ENCRYPTION', 'ssl'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'sendmail' => '/usr/sbin/sendmail -bs',
];
我研究了幾個小時,但無法解決這個問題,有什麼建議嗎? P/S:我使用Windows 10和XAMPP的Web服務器
您是否嘗試過使用'tls'加密,而不是'ssl'? – James