I would like to send email via my gmail address using CodeIgniter. I tried many solutions, but none of them work.
My code :
$config = array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => 'xxxxx@gmail.com',
'smtp_pass' => 'yyyyy',
'mailtype' => 'html',
'charset' => 'utf-8',
'wordwrap' => TRUE
);
$this->load->library('email', $config);
$this->email->from('xxxxx@gmail.com', 'admin');
$this->email->to('zzzzz@gmail.com');
$this->email->subject('Email test');
$msg = "Testing email.";
$this->email->message($msg);
$this->email->send();
echo $this->email->print_debugger();
I have the following error :
Message: fwrite(): send of 5 bytes failed with errno=32 Broken pipe
Filename: libraries/Email.php
and
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.
For the moment, I'am working in localhost.
Thank you for helping me.