Hello Stack Overflow community,
I'm encountering an issue in my PHP-based LMS system where email verification codes are not being sent successfully during user registration. Here are the key details:
- PHP Version: 7.3.9
- Email Sending Method: SMTP
During user registration, a verification code is generated, but the email with the code is not reaching the user's inbox. Below is a simplified version of the relevant PHP code:
Controller - Admin:
public function smtp_settings($param1 = "")
{
public function smtp_settings($param1 = "")
{
if ($this->session->userdata('admin_login') != true) {
redirect(site_url('login'), 'refresh');
}
// CHECK ACCESS PERMISSION
check_permission('settings');
if ($param1 == 'update') {
$this->crud_model->update_smtp_settings();
$this->session->set_flashdata('flash_message', get_phrase('smtp_settings_updated_successfully'));
redirect(site_url('admin/smtp_settings'), 'refresh');
}
$page_data['page_name'] = 'smtp_settings';
$page_data['page_title'] = get_phrase('smtp_settings');
$this->load->view('backend/index', $page_data);
}
}