trying to make a reset password function for my website however I cant get past sending an email without this error occuring.
Unable to send email using PHP mail(). Your server might not be configured to send mail using this method.
I am using gmail as the host to send the email. Here is the part of the function that is used to send the email.
$user_email = $this->input->post('email_address');
$query = $this->db->get_where('account', array('email_address' => $user_email));
if($query) {
$config['protocal'] = 'smtp';
$config['mail_path'] = 'ssl://smtp.googlemail.com';
$config['smtp_host'] = 'ssl://smtp.googlemail.com';
$config['smtp_port'] = '465';
$config['smtp_user'] = 'USEREMAIL';
$config['smtp_pass'] = 'PASSWORD';
$config['charset'] = "utf-8";
$config['mailtype'] = "html";
$config['newline'] = "\r\n";
$this->email->initialize($config);
$this->email->from('matthew.attanasio135@gmail.com', 'Matthew');
$this->email->to($user_email);
$this->email->subject('Email Test');
$this->email->message('<h1>Testing the email class.<h1>');
$this->email->send();
if ( ! $this->email->send()) {
show_error($this->email->print_debugger());
}
else {
echo('DONE');
}
I am also getting this error::
Message: Undefined index: Subject
I do not understand why this is happening could you please help me out thank you.