sending mail problem

#1
[eluser]mrcoder[/eluser]
Hi,

I am new to codeigniter .I have implemented a forget password.but iam getting error in view page as undefined varible user_details please check it any help me.

function forgetpasswordaction() {

$this->load->helper(array('form', 'url'));
$this->load->library('email');
$data['title'] = "OneLine # Concept & Design I Desktop Publishing & Prepress I Print & Logistics";
$data['headline'] = "Welcome!";
$data['header'] = 'header';
$data['menu'] = 'menu';
$data['fotter'] = "Copyright © 2008 oneline.es. All rights reserved.";
$data['include'] = 'home';
$email = $this->input->xss_clean($this->input->post('email'));
$this->load->model('login_model', '', True);
$res = $this->login_model->checkemail($email);

if ($res == "Exists") {

$this->email->from('[email protected]', 'oneline');
$this->email->to('$email');
$data['user_details'] =$this->login_model->forgetpassword($email);
foreach($user_details as $row)
{
$this->email->subject('forget password');
$this->email->message('your password is'.$row->$password);

$this->email->send();
}
$this->load->view('loginpage', $data);

} else {
$data['errormessage'] = "Entered email id not valid";
$this->load->view('forgetpassword', $data);
}


}

#2
[eluser]pistolPete[/eluser]
I guess you need to change your code to
Code:
$data['user_details'] =$this->login_model->forgetpassword($email);
foreach($data['user_details'] as $row)
{
          $this->email->subject('forget password');
          $this->email->message('your password is'.$row->$password);
          $this->email->send();
}


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.