Enviar correo con CodeIgnitor Email Library

Recibo un error cada vez que bash enviar un correo electrónico usando el código de encendido. Tengo un formulario donde los usuarios envían los datos si tienen éxito, se envía un mensaje de bienvenida al usuario. Archivo Ajax para pasar los datos al controlador

$("#submit-details").on("submit", function(){ $.ajax({ type: 'POST', url: ''+'index.php/car/host ', data: $("#submit-details").serialize(), asyn: false, }).done(function (data) { console.log(data); }); $("#submit-details")[0].reset(); $(".contact-form, .form-btns").hide(); $(".contact-confirm").show(); return false; }); 

Aquí está mi controlador. host de función pública ()

 public function host() { $field = array( 'first_name' =>$this->input->post('first_name'), 'last_name' =>$this->input->post('last_name'), 'email_address' =>$this->input->post('email_address'), 'cities' =>$this->input->post('cities'), 'registration_number' =>$this->input->post('registration_number'), 'vehicle_make' =>$this->input->post('vehicle_make'), 'vehicle_model' =>$this->input->post('vehicle_model'), 'vehicle_registration_year' =>$this->input->post('vehicle_registration_year'), ); $result = $this->Drivetrymodel->host($field); $this->Drivetrymodel->welcomeHostEmail($this->input->post('email_address');); // $msg['success'] = false; if ($result) { $msg['success'] = true; } echo json_encode($msg); } 

Y aquí está mi modelo.

 public function welcomeHostEmail(){ $from = "address@mail.com"; //senders email address $subject = 'Welcome !'; //email subject //sending email inside message body $message = $this->load->view("frontend/emails/welcomehost", TRUE); //config email settings $config['protocol'] = 'smtp'; $config['smtp_host'] = 'smtpout.secure.net'; $config['smtp_port'] = '465'; $config['smtp_user'] = $from; $config['smtp_pass'] = '*******'; //sender's password $config['mailtype'] = 'html'; $config['charset'] = 'iso-8859-1'; $config['wordwrap'] = 'TRUE'; $config['newline'] = "\r\n"; $this->load->library('email', $config); $this->email->initialize($config); //send email $this->email->from($from); $this->email->to($receiver); $this->email->subject($subject); $this->email->message($message); // $this->email->send(); if($this->email->send()){ //for testing echo "sent to: ".$receiver."
"; echo "from: ".$from. "
"; echo "protocol: ". $config['protocol']."
"; echo "message: ".$message; return true; }else{ echo "email send failed"; return false; } return $this->email->print_debugger(); }

Si ejecuto esto es lo que obtengo.

 

A PHP Error was encountered

Severity: 4096

Message: Object of class CI_Loader could not be converted to string

Filename: libraries/Email.php

Line Number: 677

si trato de convertir el mensaje a cadena pasando cadena vacía como esta

 $message = $this->load->view("frontend/emails/welcomehost", "", TRUE); 

Aparece un nuevo error 500 (Error interno del servidor).