Iam using codeigniter
I exicuted the code on live server. got the following error using print_debugger()
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.
public function sendEnquiry() { $this->load->library('email'); $name = $this->input->post("fname"); $cemail = $this->input->post("email"); $pno = $this->input->post("phone"); $message = $this->input->post("message"); $config['protocol'] = 'smtp'; $config['smtp_host'] = 'ssl://mail.gatewaykhobar.com'; $config['smtp_port'] = '465'; $config['smtp_timeout'] = '7'; $config['smtp_user'] = '***********'; $config['smtp_pass'] = '***********'; $config['charset'] = 'utf-8'; $config['newline'] = "\r\n"; $config['mailtype'] = 'text'; // or html $config['validation'] = FALSE; $this->email->initialize($config); $this->email->from('info@gatewaykhobar.com','Gateway Restaurent Contact'); $this->email->to($cemail); $this->email->subject('Gateway Restaurent Contact Enquiry'); $this->email->message($message); $send = $this->email->send(); if($send) { echo json_encode("send"); } else { $error = $this->email->print_debugger(array('headers')); echo json_encode($error); } }