email - Why mail not send from my localhost php 7 in codeigniter -
from localhost, cannot send email using gmail account. i've used php 7.0.9 , codeigniter. wrote code in controller is-
$this->load->library('email'); $config['protocol'] = 'smtp'; $config['smtp_host'] = 'ssl://smtp.googlemail.com'; $config['smtp_port'] = '25'; $config['smtp_user'] = 'xxx@gmail.com'; $config['smtp_pass'] = 'password'; $config['charset'] = 'utf-8'; $config['newline'] = "\r\n"; $config['mailtype'] = 'html'; $config['wordwrap'] = true; $this->email->initialize($config); $this->email->from('xxx@gmail.com'); $this->email->to('aaaa@yahoo.com'); $this->email->subject("welcome xx."); $this->email->message('message body.....'); if ($this->email->send()) { $data['success'] = 1; } else { $data['success'] = 0; $data['error'] = $this->email->print_debugger(array('headers')); } echo "<pre>"; print_r($data); echo "</pre>";
but got error
array
( [success] => 0 [error] => following smtp error encountered: 0 unable send data: auth login failed send auth login command. error: unable send data: mail from:
from:
the following smtp error encountered: unable send data: rcpt to:
to:
the following smtp error encountered: unable send data: data
data:
the following smtp error encountered: unable send data: user-agent: codeigniter date: wed, 26 oct 2016 12:10:08 +0200
anyone please give me suggestion it.
Comments
Post a Comment