PHP SwiftMailer: sending email with SMTP give `SSL operation failed` while startTLS is enabled -
i want send email using swiftmailer(v5.4.1)
library in yii1(1.1.17)
. here configuration mailer component in main.php(configuration file):
'mailer' => array( 'class' => 'application.components.swiftmailer', 'host' => 'xx.xx.xx.xx', 'type' => 'smtp', 'port' => 587, 'username' => 'username', 'password' => 'password', 'fromname' => 'sample_name', 'fromaddress' => 'sample_email', 'security' => 'tls', ),
mail server , application server in internal network of our company.
when attempt send email receive warning.
want know reason , send emails after did handshake server using starttls(it enabled in server, assured network manager).
stream_socket_enable_crypto(): ssl operation failed code 1. openssl error messages: error:14090086:ssl routines:ssl3_get_server_certificate:certificate verify failed
/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 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 shutdown logic needed. 100 */
Comments
Post a Comment