[eluser]mi6crazyheart[/eluser]
Just made a small change. Try this...
Code:
class Reg_controller extends Controller{
function index(){
$this->load->helper(array(“form”,“html”,“url”,‘email’));
$this->load->library(‘form_validation’);
$this->load->language(‘registration’);
$this->load->view(‘tocheck’);
$this->load->database();
$this->load->model(‘registermodel’);
$this->form_validation->set_rules(‘entry_date’, ‘Date ‘, ‘required’);
if ($this->form_validation->run() == true){
if($this->input->post(‘utype’)==‘R’){
$reslt = $this->registermodel->insert_register();
if($reslt==1){
$this->load->library(‘email’);
$this->email->from(‘[email protected]’,‘Our site’);
$this->email->to(“[email protected]”);
$this->email->subject(‘Email Test’);
$this->email->message(‘Testing the email class in codeIgniter.’);
$this->email->send();
echo “[removed]
alert(‘New user is added!..’);
[removed]”;
}
}
}
}
}