带有TLS加密的Laravel SMTP驱动 [英] Laravel SMTP driver with TLS encryption
本文介绍了带有TLS加密的Laravel SMTP驱动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试发送一封包含此配置的电子邮件:
return [
'driver'=> 'smtp',
'host'=> 'mail.mydomain.com',
'port'=> 26,
'from'=> ['address'=> 'mailer@mydomain.com','name'=> 'Mailer'],
'encryption'=> 'tls',
'username'=> env('MAIL_USERNAME'),
'password'=> env('MAIL_PASSWORD'),
'sendmail'=> '/ usr / sbin / sendmail -bs',
'pretend'=>假,
];
当我提交表单时,我收到这个erorr:
$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $
$ 14090086:SSL例程:SSL3_GET_SERVER_CERTIFICATE:证书验证失败
我发现这个解决方案,人们似乎已经解决了问题与同一个图书馆,但我无法解决它在Laravel。
https://github.com/PHPMailer/PHPMailer/issues/368
解决方案
在该链接中,您提供的解决方案是直接的。
正确的解决方案是修复您的SSL配置 - 这不是PHP的错误!
I'm trying to send an email with this configuration:
return [
'driver' => 'smtp',
'host' => 'mail.mydomain.com',
'port' => 26,
'from' => ['address' => 'mailer@mydomain.com', 'name' => 'Mailer'],
'encryption' => 'tls',
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'sendmail' => '/usr/sbin/sendmail -bs',
'pretend' => false,
];
When I submit the form I receive this erorr:
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
I found this solution where people seems to have solved the problem with the same library but I cant manage to solve it in Laravel.
https://github.com/PHPMailer/PHPMailer/issues/368
解决方案
Well in that link you provided the solution is straight-forward.
The correct solution is to fix your SSL config - it's not PHP's fault!
这篇关于带有TLS加密的Laravel SMTP驱动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文