我正在使用codeigniter&离子认证。我在尝试向用户发送电子邮件时遇到问题。
这是有效的:
$message = 'hello';
$this->email->from($this->config->item('admin_email', 'ion_auth'), $this->config->item('site_title', 'ion_auth'));
$this->email->to($user->email);
$this->email->subject($this->config->item('site_title', 'ion_auth') . ' - ' . $this->lang->line('email_forgotten_password_subject'));
$this->email->message($message);
当我改为使用tpl时,它不起作用:
/views/forgot_password.tpl.php
$message = $this->load->view('forgot_password.tpl.php', $data, TRUE);
$this->email->from($this->config->item('admin_email', 'ion_auth'), $this->config->item('site_title', 'ion_auth'));
$this->email->to($user->email);
$this->email->subject($this->config->item('site_title', 'ion_auth') . ' - ' . $this->lang->line('email_forgotten_password_subject'));
$this->email->message($message);
请指教,谢谢。
答案 0 :(得分:0)
在您的代码中将“forgot_password.tpl.php”更改为“forgot_password.tpl”:
$message = $this->load->view('forgot_password.tpl.php', $data, TRUE);
$ this-> load-> view()中不需要.php。