[eluser]Unknown[/eluser]
I have an error with the CI Email Class. It works fine on my localhost, but when I upload the project on the server, a timeout occurs. Have tried looking through the entire logic. Can someone help me out?
Code:
function contact()
{
$name = $this->input->post('name');
$email = $this->input->post('email');
$subject = $this->input->post('subject');
$message = $this->input->post('message');
$data['contact'] = 'contact_submitted_view';
$config = array(
'protocol'=>'smtp',
'smtp_host'=>'xxx',
'smtp_port'=>465,
'smtp_user'=>'xxx',
'smtp_timeout'=>15,
'smtp_pass'=>'xxx',
'mailtype'=>'html'
);
$this->load->library('email',$config);
$this->email->set_newline("\r\n");
// Set to, from, message, etc.
$this->email->from('xxx');
$this->email->to('xxx');
$this->email->subject($subject);
$this->email->message('Client Name:'.$name.'<br/>Client Email: '.$email.'<br/>Message:'.$message);
if($this->input->post('ajax'))
{
if($this->email->send())
{
$this->load->view($data['contact']);
}
else
{
show_error($this->email->print_debugger());
}
}
else{
if($this->email->send())
{
$this->load->view('contact_submitted_view');
}
else
{
show_error($this->email->print_debugger());
}
}
}
I have used ajax form submission, but the error is not with the js I'm sure of that.
Any help appreciated!!