我想从我的应用程序向用户发送一封电子邮件,其中包含从视图中加载的电子邮件的内容 .这是我到目前为止尝试过的代码:
$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();
Run Code Online (Sandbox Code Playgroud) 我在我的模型中创建一个函数,如:
public function getAllMenuByOnlyActionPage($actionlot){
$act = trim($actionlot);
$result = $this->tableGateway->select(function (Select $select) {
$select->where(array('status != ?' => 13))
->where(array('action' => $act))
->order('id ASC');
});
$results = array();
foreach ($result as $row) {
$results[] = $row;
}
return $results;
}
Run Code Online (Sandbox Code Playgroud)
当我尝试执行时,它会告诉我Notice: Undefined variable: act.我已经看到这个链接ZF2 tableGateway选择,但我想为这个功能设置参数.谢谢