$your_name = $this->input->post('your_name');
$your_email = $this->input->post('your_email');
$to_email = $this->input->post('to_email');
$subject = $this->input->post('subject');
$message = $this->input->post('message');
$this->load->library('email');
$this->email->from($your_email,$your_name);
$this->email->to($to_email);
$this->email->subject($subject);
$this->email->message($message);
if($this->email->send())
{
echo 'Sent successfully,<a href="/ci/index.php/email">return</a>.';
}
else
{
show_error($this->email->print_debugger());
}