Solusi ketika anda dihadapkan oleh pesan error
Asumsi disini bahwa konfigurasi mail sudah sesuai :
public function lupa_password(){Jika script diatas dicoba maka akan muncul pesan error diatas, bagaimana solusinya, solusinya ialah mengganti :
$email = $this->input->post('email');
$data_user = $this->m_lapor_api->check_email($email)->result();
if(count($data_user)>1){
foreach($data_user as $data){
$this->load->library('email');
$email = $data->email;
$config = Array(
'protocol' => "smtp",
'smtp_host' => "domain.com",
'smtp_port' => 465,
'smtp_user' => "admin@domain.com",
'smtp_pass' => "passwordUserMail",
'smtp_crypto' => "ssl", //can be 'ssl' or 'tls' for example
'mailtype' => "html",
'smtp_timeout' => "4",
'charset' => "iso-8859-1",
'wordwrap' => TRUE
);
$this->email->initialize($config);
$this->email->set_newline("\r\n");
// Set to, from, message, etc.
$this->email->to($email);
$this->email->from("admin@domain.com","Layanan Email");
$this->email->bcc("admin@domain.com");
$this->email->subject("Layanan Lupa Password");
$this->email->message("password anda ".$data->password);
if(! $this->email->send()){
echo "sukses";
}else{
echo "gagal";
}
}
}
echo $this->email->print_debugger();
}
'protocol' => "smtp"Dengan :
'protocol' => "sendmail",
Demikian solusi praktis dari kasus
"fsockopen()... ",
Semoga Bermanfaat