Haloo! Selamat Datang di Komunitas Private Training Web Development (48216 Members, 455 Projects, 3700 Topic, 10094 Comments)

Butuh karyawan baru? atau seorang Web Developer (Part-time/Freelance/Full-time), cari disini : Members Area Jobs!
Marketplace Multi Seller Multi Buyer - Fitur Lupa Password tidak berjalan
Bagus Windhu Aponsa Mengatakan : Members -
Rate Topic :
  1. Assalamualaikum Warahmatullahi Wabarakatuh... saya ingin bertanya mengapa lupa password tidak bekerja ya? apakah ada yang salah
  2.  
  3. function lupapassword(){
  4. if (isset($_POST['lupa'])){
  5. $email = strip_tags($this->input->post('email'));
  6. $cekemail = $this->model_app->edit('users', array('email' => $email))->num_rows();
  7. if ($cekemail <= 0){
  8. $data['title'] = 'Alamat email tidak ditemukan';
  9. $this->load->view('administrator/view_login',$data);
  10. }else{
  11. $iden = $this->model_app->edit('identitas', array('id_identitas' => 1))->row_array();
  12. $usr = $this->model_app->edit('users', array('email' => $email))->row_array();
  13. $this->load->library('email');
  14.  
  15. $tgl = date("d-m-Y H:i:s");
  16. $subject = 'Lupa Password ...';
  17. $message = "<html><body>
  18. <table style='margin-left:25px'>
  19. <tr><td>Halo $usr[nama_lengkap],<br>
  20. Seseorang baru saja meminta untuk mengatur ulang kata sandi Anda di <span style='color:red'>$iden[url]</span>.<br>
  21. Klik di sini untuk mengganti kata sandi Anda.<br>
  22. Atau Anda dapat copas (Copy Paste) url dibawah ini ke address Bar Browser anda :<br>
  23. <a href='".base_url().$this->uri->segment(1)."/reset_password/$usr[id_session]'>".base_url().$this->uri->segment(1)."/reset_password/$usr[id_session]</a><br><br>
  24.  
  25. Tidak meminta penggantian ini?<br>
  26. Jika Anda tidak meminta kata sandi baru, segera beri tahu kami.<br>
  27. Email. $iden[email], No Telp. $iden[no_telp]</td></tr>
  28. </table>
  29. </body></html> \n";
  30.  
  31. $this->email->from($iden['email'], $iden['nama_website']);
  32. $this->email->to($usr['email']);
  33. $this->email->cc('');
  34. $this->email->bcc('');
  35.  
  36. $this->email->subject($subject);
  37. $this->email->message($message);
  38. $this->email->set_mailtype("html");
  39. $this->email->send();
  40.  
  41. $config['protocol'] = 'sendmail';
  42. $config['mailpath'] = '/usr/sbin/sendmail';
  43. $config['charset'] = 'utf-8';
  44. $config['wordwrap'] = TRUE;
  45. $config['mailtype'] = 'html';
  46. $this->email->initialize($config);
  47.  
  48. $data['title'] = 'Password terkirim ke '.$usr['email'];
  49. $this->load->view('administrator/view_login',$data);
  50. }
  51. }else{
  52. redirect($this->uri->segment(1));
  53. }
  54. }
Robby Prihandaya Mengatakan :
Admin -
  1. Assalamualaikum,.. Bisa jadi karena hostingnya tidak mengizinkan menggunakan function mail,
  2. jadi sebaiknya ganti menjadi smtp, caranya ikuti topic berikut ini :
  3. https://members.phpmu.com/forum/read/ganti-phpmail-menjadi-smtp-web-komunitas-penulis-artikel-lepas-ci

Bagus Windhu Aponsa Mengatakan :
Members -
  1. Assalamualaikum,.. masih tidak dapat digunakan, untuk pengaturan gmail sudah saya setting
  2.  
  3. $this->email->from($iden['email'], $iden['nama_website']);
  4. $this->email->to($usr['email']);
  5. $this->email->cc('');
  6. $this->email->bcc('');
  7.  
  8. $this->email->subject($subject);
  9. $this->email->message($message);
  10. $this->email->set_mailtype("html");
  11. $this->email->send();
  12.  
  13. $config['protocol'] = 'smtp';
  14. $config['smtp_host'] = 'ssl://smtp.googlemail.com';
  15. $config['smtp_port'] = '25';
  16. $config['smtp_user'] = 'windunc@gmail.com';
  17. $config['smtp_pass'] = '********';
  18. $config['charset'] = 'utf-8';
  19. $config['newline'] = "\r\n";
  20. $config['wordwrap'] = TRUE;
  21. $config['mailtype'] = 'html'; // or html
  22. $config['validation'] = TRUE; // bool whether to validate email or not
  23. $this->email->initialize($config);
  24.  
  25. $data['title'] = 'Password terkirim ke '.$usr['email'];
  26. $this->load->view('administrator/view_login',$data);
  27. }

Robby Prihandaya Mengatakan :
Admin -
  1. Assalamualaikum,.. kemanan/security pada google accountnya :
  2. pastikan email gmailnya TIDAK menggunakaan verifikasi 2 langkah, jika pake sebaiknya di nonaktifkan,
  3. pada pilihan "Akses aplikasi yang kurang aman" harus di aktifkan,..

Maaf, Untuk Memberikan Komentar Anda Harus Login !!!