[英]Unable to send SSL/TLS smtp emails in Laravel 7
PHP version: 7.4.5 PHP 版本:7.4.5
Laravel version: 7 Laravel 版本:7
Swiftmailer version: 6.2.3 Swiftmailer 版本:6.2.3
Swift_TransportException Connection could not be established with host... :stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
Working -> I think there was a breaking change in underlying libs and used encryption methods, cause I have systems where it is working with the exactly same swiftmailer version.工作-> 我认为底层库和使用的加密方法发生了重大变化,因为我的系统使用完全相同的 swiftmailer 版本。
stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
Connection could not be established with host... :stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
Connection could not be established with host... :stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
What am I doing wrong here?我在这里做错了什么?
The solution was really trivial.解决方案真的很简单。
What was needed to solve this problem, was to set up MAIL_ENCYRPTION
to tcp
in .env
.解决此问题所需的是将
MAIL_ENCYRPTION
设置为tcp
中的.env
。 instead of tls
or ssl
on corresponding ports.而不是相应端口上的
tls
或ssl
。
For some strange reasons, setting tls
(no matter version) or ssl
, with proper ports didn't work.由于一些奇怪的原因,使用正确的端口设置
tls
(无论版本)或ssl
不起作用。
Therefore, if you are experiencing these types of problems, please set MAIL_ENCYRPTION=tcp
- this should solve your errors.因此,如果您遇到这些类型的问题,请设置
MAIL_ENCYRPTION=tcp
- 这应该可以解决您的错误。
Happy coding...快乐的编码...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.