I tried many things over stackoverflow but still can not mail, maybe my configuration is wrong; the code is running in a live server
public function(){
// configuration
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => 'my_email',
'smtp_pass' => 'my_password',
'mailtype' => 'html',
'charset' => 'iso-8859-1',
'wordwrap' => true
);
$this->load->library('email',$config);
$this->email->from('my_email','Administrator');
$this->email->to('my_friends_email');
$this->email->subject($subject);
$this->email->message($message);
return ($this->email->send()); }