PHP SwiftMailer:启用startTLS时,使用SMTP发送电子邮件时给出“SSL操作失败”
我想使用PHP SwiftMailer:启用startTLS时,使用SMTP发送电子邮件时给出“SSL操作失败”,php,ssl,smtp,swiftmailer,starttls,Php,Ssl,Smtp,Swiftmailer,Starttls,我想使用Yii1(1.1.17)中的SwiftMailer(v5.4.1)库发送电子邮件。下面是我在main.php(配置文件)中对mailer组件的配置: 邮件服务器和应用服务器在公司内部网络中 当我尝试发送电子邮件时,我收到此警告 我想知道原因,并在成功使用startTLS与服务器握手后发送电子邮件(它在服务器中启用,由网络管理器保证) stream\u socket\u enable\u crypto():SSL操作失败,代码为1。OpenSSL错误消息: 错误:14090086:SSL例
Yii1(1.1.17)
中的SwiftMailer(v5.4.1)
库发送电子邮件。下面是我在main.php(配置文件)中对mailer组件的配置:邮件服务器和应用服务器在公司内部网络中
当我尝试发送电子邮件时,我收到此警告
我想知道原因,并在成功使用startTLS与服务器握手后发送电子邮件(它在服务器中启用,由网络管理器保证)
stream\u socket\u enable\u crypto():SSL操作失败,代码为1。OpenSSL错误消息:
错误:14090086:SSL例程:SSL3\u获取\u服务器\u证书:证书验证失败
/home/mohammad/workspace/ir.wsi.recruitment/protected/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php(95)
083 case 'blocking':
084 if ($this->_stream) {
085 stream_set_blocking($this->_stream, 1);
086 }
087
088 }
089 }
090 $this->_params[$param] = $value;
091 }
092
093 public function startTLS()
094 {
095 main error: return stream_socket_enable_crypto($this->_stream, true, STREAM_CRYPTO_METHOD_TLS_CLIENT);
096 }
097
098 /**
099 * Perform any shutdown logic needed.
100 */
101 public function terminate()
102 {
103 if (isset($this->_stream)) {
104 switch ($this->_params['type']) {
105 case self::TYPE_PROCESS:
106 fclose($this->_in);
107 fclose($this->_out);
Stack Trace
#0
–
/home/mohammad/workspace/ir.wsi.recruitment/protected/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php(95): stream_socket_enable_crypto(resource, true, 9)
090 $this->_params[$param] = $value;
091 }
092
093 public function startTLS()
094 {
095 return stream_socket_enable_crypto($this->_stream, true, STREAM_CRYPTO_METHOD_TLS_CLIENT);
096 }
097
098 /**
099 * Perform any shutdown logic needed.
100 */
我已经找到了这个答案(),但它是纯邮件函数,不适用于yii中的SwiftMailer,但非常有用!我已经找到了这个答案(),但它是纯邮件函数,不适用于yii中的SwiftMailer,但非常有用!
/home/mohammad/workspace/ir.wsi.recruitment/protected/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php(95)
083 case 'blocking':
084 if ($this->_stream) {
085 stream_set_blocking($this->_stream, 1);
086 }
087
088 }
089 }
090 $this->_params[$param] = $value;
091 }
092
093 public function startTLS()
094 {
095 main error: return stream_socket_enable_crypto($this->_stream, true, STREAM_CRYPTO_METHOD_TLS_CLIENT);
096 }
097
098 /**
099 * Perform any shutdown logic needed.
100 */
101 public function terminate()
102 {
103 if (isset($this->_stream)) {
104 switch ($this->_params['type']) {
105 case self::TYPE_PROCESS:
106 fclose($this->_in);
107 fclose($this->_out);
Stack Trace
#0
–
/home/mohammad/workspace/ir.wsi.recruitment/protected/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php(95): stream_socket_enable_crypto(resource, true, 9)
090 $this->_params[$param] = $value;
091 }
092
093 public function startTLS()
094 {
095 return stream_socket_enable_crypto($this->_stream, true, STREAM_CRYPTO_METHOD_TLS_CLIENT);
096 }
097
098 /**
099 * Perform any shutdown logic needed.
100 */