2014-06-21 2 views
3

새 암호를 전자 메일로 다시 설정하기 위해 제출하면 CodeIgniter는 메일을 보내지 않습니다. 하지만 메시지를 반환 중입니다 비밀 번호 재설정 이메일 보낸. 따라서 오류가 발생하지 않습니다.암호 인증 암호를 잊어 버렸을 때 전자 메일을 보내지 않음

나는 CodeIgniter의 2.1.4 및 IonAuth 2.5.2

이미 TRUE이 설정을 설정
$config['use_ci_email'] = TRUE; 

를 사용하여, 여전히 메일을 전송하고 있지 않다.

+0

모든 솔루션을? – Prakash

답변

0

내가 CodeIgniter의 응용 프로그램/설정/email.php로

$config['protocol'] = 'mail'; 
$config['wordwrap'] = false; 
$config['mailtype'] = 'html'; 

응용 프로그램/설정/autoload.php 컨트롤러에서

$autoload['libraries'] = array('lang','template', 'email','form_validation','session','encrypt','pagination','upload','database'); 

변경

$this->email->from(MAIL,MAIL); 
$this->email->to($mailto); 
$this->email->subject($text_subject); 
$this->email->message($this->load->view('email/template_email',$data,TRUE)); 
$this->email->send(); 
0

하지 아무것도 설정을 사용 'ion_auth.php'에 있습니다. 이 같은 그대로 파일 :

$config['use_ci_email'] = FALSE; // Send Email using the builtin CI email class, if false it will return the code and the identity 
$config['email_config'] = array(
    'mailtype' => 'html', 
); 

하고 변화 컨트롤러 파일이 같은 일부 코드 'Auth.php'아직

if ($forgotten) 
      { 
       // if there were no errors 
//    $this->session->set_flashdata('message', $this->ion_auth->messages()); 
//    redirect("auth/login"); //we should display a confirmation page here instead of the login page 
          $config = [ 
              'protocol' => 'smtp', 
              'smtp_host' => 'ssl://smtp.googlemail.com', 
              'smtp_port' => 465, 
              'smtp_user' => 'xxx', 
              'smtp_pass' => 'xxx', 
              'mailtype' => 'html' 
             ]; 
          $data = array(
           'identity'=>$forgotten['identity'], 
           'forgotten_password_code' => $forgotten['forgotten_password_code'], 
          ); 
          $this->load->library('email'); 
          $this->email->initialize($config); 
          $this->load->helpers('url'); 
          $this->email->set_newline("\r\n"); 

          $this->email->from('xxx'); 
          $this->email->to("xxx"); 
          $this->email->subject("forgot password"); 
          $body = $this->load->view('auth/email/forgot_password.tpl.php',$data,TRUE); 
          $this->email->message($body); 

          if ($this->email->send()) { 

           $this->session->set_flashdata('success','Email Send sucessfully'); 
           return redirect('auth/login'); 
          } 
          else { 
           echo "Email not send ....."; 
           show_error($this->email->print_debugger()); 
          } 
      } 
      else 
      { 
       $this->session->set_flashdata('message', $this->ion_auth->errors()); 
       redirect("auth/forgot_password"); 
      }