I have a problem when sending email using codeigniter and when i'm printing
$this->email->print_debugger();
it prints:
"Your message has been successfully sent using the following protocol: mail"
but the user can't receive any email after it successfully sends.
here is my code when sending email:
date_default_timezone_set('Asia/Manila');
$this->load->helper('string');
$password= random_string('alnum', 8);
$data = array ('password' => md5($password),
'tag' => 0
);
$this->db->where('emp_id', $user['employee_id']);
$this->db->update('credentials', $data);
$this->load->library('email');
$this->email->from('noreply@company.com', 'company');
//$this->email->reply_to('noreply@company.com');
$this->email->to($user['company_email']);
$this->email->subject('Password reset');
$this->email->message('You have requested a code. Here is your code: '. $password);
$check = $this->email->send();
and here is my code when in my config file:
$ci = get_instance();
$ci->load->library('email');
$config['protocol'] = "sendmail";
$config['smtp_host'] = "ssl://mail.company.com";
//$config['smtp_port'] = "465";
$config['smtp_port'] = "25";
//$config['smtp_user'] = "person@company.com";
//$config['smtp_pass'] = "";
$config['charset'] = "utf-8";
$config['mailtype'] = "html";
$config['newline'] = "
";
$config['crlf'] = "
";
$ci->email->initialize($config);
when we are in the internal network, i can send email successfully. but when i'm at home trying to send email. the code still works but the user can't receive email. thanks in advance guys !