⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

sending emails



lanis
  • profile picture
  • Member

Posted 26 June 2013 - 03:15 AM

Hi everyone!

 

I have this model and I get the email which I want to send

class People_Model extends CI_Model{

public function getInfo($id){

$this->db->select('*');
    $this->db->from('people');

    $query = $this->db->get();

    if($query->num_rows() > 0)
    {
        foreach ($query->result_array() as $row)
        {
            return $row['email'];
        }
    }
    else
    {
        return FALSE;
    }
}
}

and in my controller

 

$this->load->model('people_model', 'people');

$clientInfo = $this->people->getInfo($id); 

$this->email->from('myemail@server.com', 'My Title'); 
$this->email->to($clientInfo);  

$this->email->subject('My Subject'); 
$this->email->message('Your User is '.$clientInfo.' and your Password is '.$pass); // I can get the email but $pass of course can't get any value in this case.

$this->email->send(); 

 

I need some help here because I can get the email and it can send it perfectly but in the message I need to send the password also and I don't know how I can get it from the model.

thanks in advance!