簡體   English   中英

郵件帳戶中未收到ion auth忘記密碼郵件

[英]ion auth forgot password mail not received in mail account

在ion auth中,我忘記了密碼的郵件已成功發送,但未在我的電子郵件帳戶中收到...我搜索了許多教程,但找不到任何解決方案。

請幫我解決這個問題。

我的電子郵件配置文件

 $config['email_config'] = array( 'mailtype' => 'html', 'protocol' => 'smtp', 'smtp_host' => 'ssl://smtp.gmail.com', 'smtp_port' => '465', 'smtp_user' => 'k10kevalam@gmail.com', 'smtp_pass' => 'k10@kevalam', ); 
在ion_auth配置中

 $config['use_ci_email'] = TRUE; // Send Email using the builtin CI email class, if false it will return the code and the identity $config['email_config'] = 'file'; 

在ion_auth.php庫中

 if ($this->email->send()) { echo $this->email->print_debugger(); $this->set_message('forgot_password_successful'); return TRUE; } 

顯示消息:“已發送電子郵件”

在我的ion_auth.php控制器中

 function forgot_password() { { $this->form_validation->set_rules('email', $this->lang->line('forgot_password_username_identity_label'), 'required'); } else { $this->form_validation->set_rules('email', $this->lang->line('forgot_password_validation_email_label'), 'required|valid_email'); } if ($this->form_validation->run() == false) { //setup the input $this->data['email'] = array('name' => 'email', 'id' => 'email', ); if ( $this->config->item('identity', 'ion_auth') == 'username' ){ $this->data['identity_label'] = $this->lang->line('forgot_password_username_identity_label'); } else { $this->data['identity_label'] = $this->lang->line('forgot_password_email_identity_label'); } //set any errors and display the form $this->data['message'] = (validation_errors()) ? validation_errors() : $this->session->flashdata('message'); $this->_render_page('auth/forgot_password', $this->data); } else { // get identity from username or email if ( $this->config->item('identity', 'ion_auth') == 'username' ){ $identity = $this->ion_auth->where('username', strtolower($this->input->post('email')))->users()->row(); } else { $identity = $this->ion_auth->where('email', strtolower($this->input->post('email')))->users()->row(); } if(empty($identity)) { if($this->config->item('identity', 'ion_auth') == 'username') { $this->ion_auth->set_message('forgot_password_username_not_found'); } else { $this->ion_auth->set_message('forgot_password_email_not_found'); } $this->session->set_flashdata('message', $this->ion_auth->messages()); redirect("auth/forgot_password", 'refresh'); } //run the forgotten password method to email an activation code to the user $forgotten = $this->ion_auth->forgotten_password($identity->{$this->config->item('identity', 'ion_auth')}); if ($forgotten) { //if there were no errors $this->session->set_flashdata('message', $this->ion_auth->messages()); redirect("auth/login", 'refresh'); //we should display a confirmation page here instead of the login page } else { $this->session->set_flashdata('message', $this->ion_auth->errors()); redirect("auth/forgot_password", 'refresh'); } } } 

我應該改變什么?

您的幫助將不勝感激。

提前致謝...

最好的辦法就是創建一個測試控制器方法,該方法發送電子郵件以計算出正確的電子郵件設置。

做了一個電子郵件文件,並更改了gmail中的某些安全性...在我的電子郵件配置文件中

 <?php $config["mailtype"] = "html"; $config["protocol"] = "smtp"; $config["smtp_host"] = "ssl://smtp.googlemail.com"; $config["smtp_user"] = "xxxx@gmail.com"; $config["smtp_pass"] = "xxxx"; $config["smtp_port"] = 465; $config["crlf"] = "\\r\\n"; $config["newline"] = "\\r\\n"; ?> 

建議為電子郵件制作配置文件

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM