The script works perfectly in my localhost(Xampp,mac lion). Uploaded website to a free remote host http://cp1.runhosting.com/ and all parts where my script tries to use the email class it gives this error (mentioned on title). Any ideas?
//send_email_helper
function send_email($user_email,$subject,$msg){
$i = & get_instance();
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => 'myemail@gmail.com',
'smtp_pass' => 'mypassword',
'mailtype' => 'html',
//'charset' => 'iso-8859-1',
'charset' => 'utf-8',
'wordwrap' => TRUE
);
$i->load->library('email', $config);
$i->email->set_newline("\r\n");
$i->email->from('myemail@gmail.com','My Name');
$i->email->to($user_email);
$i->email->subject($subject);
$i->email->message($msg);
if($i->email->send()){
return true;
}else{
return false;
}
}
//function call in controller
function process(){
$this->load->helper('send_email_helper');
$user_email = $this->filterdata($this->input->post('email'));
$message = "test message blah blah...";
$subject = "test subject";
$data['email_sent'] = false;
if(send_email($user_email,$subject,$message)){
$data['email_sent'] = true;
}else{
$data['email_sent'] = false;
}
$data['chat_client'] = $this->session->userdata('chat_client');
$this->load->view('confirmation',$data);
}