我需要發送HTML電子郵件,但在添加的消息從視圖中加載HTML文件,但是當我發送電子郵件並接收它,但電子郵件爲空時,沒有文本獲取從視圖文件請建議。Codeigniter - 電子郵件分類 - HTML電子郵件加載視圖
public function sendUserMail($mail) {
$data=true;
$lang = $this->input->post("lang");
$this->email->from('[email protected]', 'Halalat');
$this->email->to($mail);
$this->email->subject('Halalat Newsletter Subscription');
$this->email->set_mailtype("html");
if ($lang == "en") {
$this->email->message = $this->load->view('email', $data, TRUE);
}
else
{
$this->email->message('<img src="http://fahad.myradio.pk/assests/images/ar/bg_ar3.jpg" />');
}
//$this->email->attach('/home/content/f/a/h/fahadghafoor/html/fahad/assests/images/en/bg_en2.jpg');//attachement testing done
$this->email->send();
echo $this->email->print_debugger();
}
顯示瀏覽文件代碼 – user2936213
'
測試HTML電子郵件
' – FormaLCodeigniter完整的HTML郵件配置:http://stackoverflow.com/a/38740292/4376484 – Pran