I am struggling in how to send email by using smtp gmail.
This error always happens to me,
[message:protected] => fsockopen(): unable to connect to ssl://smtp.gmail.com:465 (Connection refused) [string:Exception:private] => [code:protected] => 2 [file:protected] => /home/u6676613/public_html/testing/system/libraries/Email.php [line:protected] => 1689 [trace:Exception:private] => Array
Below is my configuration for sending the email
$config['protocol']='smtp';
$config['smtp_host']='ssl://smtp.gmail.com' ;
$config['smtp_port']='465';
//$config['smtp_crypto'] = 'ssl';
$config['smtp_timeout']='30';
$config['smtp_user']=$smtp_username;
$config['smtp_pass']=$smtp_password;
$config['charset']='utf-8';
$config['newline']="\r\n";
$config['mailtype'] = 'html';
$config['charset']='utf-8';
$config['newline']="\r\n";
$config['mailtype'] = 'html';
$this->load->library('email');
$this->email->initialize($config);
$this->email->from('do-not-reply@blabla.com');
$this->email->to($email);
$this->email->subject('Testing');
$this->email->message($msg);
if($this->email->send())
{
$this->success();
}
else
{
show_error($this->email->print_debugger());
}
If i try to uncomment smtp crypto, i got error " fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known"
FYI ssl extension already enabled. Kindly need your help for this matter
My problem is not ssl extension related so i think its not duplicate with another issue