php - codeigniter localhost email not sending -
i have problem , don't understand. code
$this->load->library('email'); $config['protocol'] = 'sendmail'; $config['mailpath'] = '/usr/sbin/sendmail'; $config['charset'] = 'iso-8859-1'; $config['wordwrap'] = true; $this->email->initialize($config); $this->email->from('rudzstyle@yahoo.co.id', 'your name'); $this->email->to('rudzstyle@gmail.com'); $message = $data->nama_depan.'<br>'.$this->input->post('snk'); $this->email->subject($message); $this->email->message('testing email class.'); $this->email->send(); echo $this->email->print_debugger();
that 2 email active email.
and result of debugger this
exit status code: 1 unable open socket sendmail. please check settings. unable send email using php sendmail. server might not configured send mail using method.
user-agent: codeigniter date: mon, 2 jun 2014 07:53:21 +0200 from: "your name" return-path: to: rudzstyle@gmail.com subject: =?iso-8859-1?q?riyanto test?= =?iso-8859-1?q??= reply-to: "rudzstyle@yahoo.co.id" x-sender: rudzstyle@yahoo.co.id x-mailer: codeigniter x-priority: 3 (normal) message-id: <538c1151179cb@yahoo.co.id> mime-version: 1.0
content-type: text/plain; charset=iso-8859-1 content-transfer-encoding: 8bit
testing email class.
in codeigniter, try this
$this->load->library('email'); $config['protocol']='smtp'; $config['smtp_host']='your host'; $config['smtp_port']='465'; $config['smtp_timeout']='30'; $config['smtp_user']='your mail id'; $config['smtp_pass']='your password'; $config['charset']='utf-8'; $config['newline']="\r\n"; $config['wordwrap'] = true; $config['mailtype'] = 'html'; $this->email->initialize($config); $this->email->from('no-reply@your-site.com', 'site name'); $this->email->to('to-address-mail-id'); $this->email->subject('notification mail'); $this->email->message('your message'); $this->email->send();
in $config['smtp_user']
field,give email_id , in $config['smtp_pass']
field,provide password mail.
this work.just try it. hope solve problem.
Comments
Post a Comment