I have a problem with smtp gmail using codeigniter 3, I created this code in the controller folder with the file name Auth.php. so when the user clicks the register button a verification email will be sent to the email that was registered by the user
` private function _sendEmail()
{
$config = [
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_users' => '***',
'smtp_pass' => '***',
'smtp_port' => 465,
'mailtype' => 'html',
'charset' => 'utf-8',
];
$this->email->set_newline("\r\n");
$this->load->library('email',$config);
$this->email->initialize($config);
$this->email->from('Email Sender', 'Full name in email');
$this->email->to('Recieved email');
$this->email->subject('Testing');
$this->email->message('coba coba');
if($this->email->send()) {
return true;
} else {
echo $this->email->print_debugger();
die;
}
}`
smtp.gmail.com