Someone could kindly help me out, it's a problem I've tried here and I have not found the bug yet.
The problem is this, I'm trying to send mail on the server I'm currently using where it's ssl and smtp, but it keeps giving the same error and I can not find the problem more than a week ago, the code on my controller is the following: $config['protocol'] = 'smtp';
$config['charset'] = 'UTF-8';
$config['smtp_host'] = 'smtp.XXXX';
$config['smtp_user'] = 'XXX';
$config['smtp_pass'] = 'XXXX';
$config['smtp_port'] = 587;
$config['smtp_keepalive'] = TRUE;
$config['smtp_crypto'] = 'ssl';
$this->email->initialize($config);
$this->email->from("[email protected]",'teste');
$this->email->to("[email protected]");
$this->email->subject("teste");
$this->email->message("teste");
$this->email->send();
echo $this->email->print_debugger();
and it is giving the following errors:
Message: fsockopen (): SSL operation failed with code 1. OpenSSL Error messages: error: 140770FC: SSL routines: SSL23_GET_SERVER_HELLO: unknown protocol
Message: fsockopen (): Failed to enable crypto
Message: fsockopen (): unable to connect to ssl: //smtp.XXX: 587 (Unknown error)
I can not fix it anywhere, I have already put the following code in php.ini:
extension=php_openssl.dll
However it did not work, using phpinfo and I noticed that in the Registered Stream Socket Transports
part it has ssl,sslv3,tsl
among others but it does not have sslv2 but I do not know if it influences, whether this should be the error or what the problem is.
I've tried using phpmailer but I could not use it correctly, it says the class is incorrect or something, so I'm not really sure what to do.
The phpmailer without the use of the codeiginter is working with the settings, however in the codeiginter I can not send using the same settings, someone could kindly help me, it is a little difficult to find something that helps in that part.
Many thanks to all for the help.