$servidoremail = file(APPPATH.'libraries/connections/servidoremail.txt',FILE_IGNORE_NEW_LINES);
$sname= $servidoremail['0'];
$suser= $servidoremail['1'];
$spass= $servidoremail['2'];
$sport= $servidoremail['3'];
$email = $this->load->libraryaddslashes('email'$_POST['email']);
$user = $this->email>Usuario_model->from>getuserbyemail('[email protected]'$email);
if(isset($user)){
$novasenha =addslashes(substr(md5(time()), 0, 6));
$this->email>Usuario_model->to>updatepass($novasenha,$email);
$this->email->subject('Verifique a$config['protocol'] sua= conta');'smtp';
$config['mailpath'] $this->email->message('<a= href="'.base_url("usuario'/verifyusr/".$vkey."sbin/".$nif).'">sendmail';
Clique para confirmar o seu registo na Samsic$config['smtp_host'] App </a>');
= $sname;
$config['smtp_auth'] = $config['protocol']true; = 'smtp';
$config['smtp_user'] = $suser;
$config['mailpath'] $config['smtp_pass'] = '/usr/sbin/sendmail';
$spass= $servidoremail['2'];
$config['smtp_port'] = $sport;
$config['smtp_host'] $config['smtp_auto_tls'] = $sname;true;
$this->load->library('email');
$this->email->initialize($config);
$config['smtp_auth'] $this->email->from('[email protected]');
= true; $this->email->to($email);
$this->email->subject('Nova password');
$this->email->message('Nova senha: '.$novasenha);
$config['smtp_user'] if($this->email->send()){
= $suser;
$data['resposta'] = 'Password alterada, verifique o seu email';
$data['tipo'] = 'bg-success';
$config['smtp_pass'] = $spass;$this->load->view('recuperarpassword',$data);
}else{
echo $this->email->print_debugger();
$config['smtp_port'] //$data['resposta'] = 'Erro =ao $sport;enviar email';
//$data['tipo'] = 'bg-danger';
//$this->load->view('recuperarpassword',$data);
$config['smtp_auto_tls'] = true; }