i am trying to send email using codeigniter email class but i am getting error Message: fsockopen(): unable to connect to ssl://smtp.gmail.com:465 (Connection timed out)
public function index()
{
$this->load->helper('form');
$this->load->view('sellerend/seller_signup.php');
$config = array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.gmail.com',
'smtp_port' => '465',
'smtp_user' => '[email protected]',
'smtp_pass' => 'mypassword',
'mailtype' => 'html',
'charset' => 'iso-8859-1'
);
$this->load->library('email',$config);
$this->email->initialize($config);
$this->email->set_newline("\r\n");
$this->email->from('[email protected]','my name');
$this->email->to('[email protected]');
$this->email->message('its working bro');
if ($this->email->send())
{
echo "hi its works";
}
else
{
show_error($this->email->print_debugger());
}
}