public function send_post()
{
//configuracion para gmail
$Name = $this->input->post('Name');
$Email = $this->input->post('Email');
$Company = $this->input->post('Company');
$Host = $this->input->post('Host');
$fo = $this->input->post('fo');
$cc = $this->input->post('cc');
$datestring = date('M d Y');
date_default_timezone_set("US/Central");
$time = date("h:i a");
$config = array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.gmail.com',
'smtp_port' => 465,
'mailtype' => 'html',
'smtp_user' => '***********.com',
'smtp_pass' => '*********',
'newline' => "\r\n",
);
//Load email library
$data = array(
'Name'=> $Name,
'Email' => $Email,
'Company' => $Company,
'Host' => $Host,
'Date' => $datestring,
'Time' => $time
);
$this->load->library('email',$config);
$this->email->set_newline("\r\n");
$this->email->from('****************', 'Foreigner');
$this->email->to($fo);
$this->email->cc($cc);
$this->email->subject('Foreigner Visitor System');
$body = $this->load->view('email',$data,TRUE);
$this->email->message($body);
$this->email->set_mailtype('html');
if($this->email->send()){
echo "Email was sent successfully";
return true;
}else{
echo "Error, it was not possible to send the email";
$this->email->print_debugger();
}
}