我想从我的应用程序向用户发送一封电子邮件,其中包含从 视图加载的电子邮件内容 。这是我到目前为止尝试过的代码:
$toemail = "user@email.id";
$subject = "Mail Subject is here";
$mesg = $this->load->view('template/email');
$this->load->library('email');
$config['charset'] = 'utf-8';
$config['wordwrap'] = TRUE;
$config['mailtype'] = 'html';
$this->email->initialize($config);
$this->email->to($toemail);
$this->email->from($fromemail, "Title");
$this->email->subject($subject);
$this->email->message($mesg);
$mail = $this->email->send();