load->library('email'); $config['mailtype'] = 'html'; $this->email->initialize($config); $this->email->from('no-reply@kingofdog.eu', 'KingOfDog'); $this->email->to($recipient); $this->email->subject($subject); $this->email->message($this->load->view('emails/' . $template, $templateData, true)); $this->email->send(); } }