我不知道我的代码哪一部分有问题,我打算在 codeigniter 中以 HTML 格式发送邮件,但我的邮件总是以 76 个字符换行,尽管我已将自动换行设置为 false。
这是我的代码:
$content = "<html>";
$content .= "Dear GA,<br/><br/>";
$content .= "You have request for Car use, below is the detail data :<br/>";
$content .= "<b>Request No :</b> ".$reqno."<br/>";
$content .= "<b>Date :</b> ".$date."<br/>";
$content .= "<b>Time :</b> ".$time."<br/>";
$content .= "<b>Destination :</b> ".$dest."<br />";
$content .= "<b>Passenger :</b> (".$jml.") ".$pasr."<br />";
$content .= "<br /><br /><br /><i style='color:grey'>Send By WIS System Automatic Mail</i></html>";
$ci = get_instance();
$ci->load->library('email');
$ci->email->set_mailtype("html");
$ci->email->set_wordwrap(FALSE);
$ci->email->from('noreply@chingluh.co.id', 'WIS System');
$ci->email->to('mymail@mycompany.co.id');
$ci->email->subject('Car Request');
$ci->email->message($content);
if ($this->email->send()) {
echo 'Email sent.';
}
else{
show_error($this->email->print_debugger());
}
但 html 源结果总是这样(用等号包裹)
<html>Dear GA,<br/><br/>You have request for Car use, below is the detail d=
ata :<br/><b>Request No :</b> C15L020<br/><b>Date :</b> 2015-12-11<br/><b>T=
ime :</b> 10:00<br/><b>Destination :</b> Jakarta<br /><b>Passenger :</b> (2=
) Passenger name<br /><br /><br /><br /><i style=3D'color:grey'>Send By WIS =
System Automatic Mail</i></html>
谁能给我一个建议,我该怎么办?
先谢谢
最佳答案
请包含此代码,我不确定但请尝试
$ci->email->subject('Car Request');
$ci->$email->IsHTML(true);
关于php - Codeigniter 的邮件内容始终被包装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34280372/