如果用戶lang = en,Lang變量已經在整個網絡中工作,因此顯示英文網頁,否則默認爲阿拉伯語,所以現在我需要在用戶提交數據時設置事物,以便發送電子郵件至用戶,但如果lang = en所以發送英文圖像,否則阿拉伯語IMG或味精無論我們設置,我分享我的代碼,請提出錯誤。CodeIgniter - 條件 - 電子郵件發送否則如果
public function sendUserMail($mail, $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('<img src="http://fahad.myradio.pk/assests/images/en/bg_en2.jpg" />');
} 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();
}
關閉標籤的IMG? –
已經提到! – FormaL
沒有'',你把它設置爲html的郵件MIME類型是什麼? – tomexsans