";print_r($ins_data);exit; $result=$this->db->insert('contact_reply', $ins_data); $insid=$this->db->insert_id(); if ($result) { $this->data['user'] = $this->session->userdata(); $this->data['reply_det'] = $this->db->where('id', $insid)->from('contact_reply')->get()->row_array(); $body = $this->load->view('admin/email/contact_reply', $this->data, true); $phpmail_config = settingValue('mail_config'); if (isset($phpmail_config) && !empty($phpmail_config)) { if ($phpmail_config == "phpmail") { $from_email = settingValue('email_address'); } else { $from_email = settingValue('smtp_email_address'); } } $this->load->library('email'); if (!empty($from_email) && isset($from_email)) { $mail = $this->email ->from($from_email) ->to($email) ->subject('Contact Reply') ->message($body) ->send(); //print_r($mail);exit; } $message = 'Mail Sent Successfully'; $this->session->set_flashdata('success_message', $message); echo 1; } else { $message = 'Sorry, something went wrong'; $this->session->set_flashdata('error_message', $message); } } }