我使用codeigniter发送邮件。。当我收到到处都有不需要的“=”的邮件时。以下是,
Phasellus dictum sapien a neque lutus cursus。Pellentesque sem做=或,流苏等pharetra简历。Sed iculis prvinar=igula, ornare fringilla ante viverra et.在hac栖息地,普拉提属。多尼克·维尔·奥奇米,欧盟委员会。整数eget odio est, eget malesuada=orem。Aenean Sed Tellus Dui,简历viverra risus。nullam马萨sapien, pu=vinar eleifend fringilla id, comallis eget nisi。莫里斯是个酒鬼。P=llentesque非lacinia mi。复活节,自由节,自由节,自由节,自由节,自由节,自由节,自由节,自由节,自由节,自由节,自由节,自由节,自由节,自由节,自由节,自由节,自由节,自由节,自由节,自由节,自由节,自由节,自由节,自由节,自由节,自由节,自由节,自由节,自由节,自由节,自由节,自由节,自由节,自由节,自由节,中世纪,中世纪坐垫波特u=, congue quis urna.
代码:
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'mail.****.com',
'smtp_port' => 587,
'smtp_user' => '*****@****.com',
'smtp_pass' => '*****',
'mailtype' => 'html',
'charset' => 'utf-8'
);
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
$this->email->from('udh@****.com', 'Udhaya Kumar');
$this->email->to('kat@****.com');
$this->email->subject('Review Form Submitted');
$data['name'] = "Udhaya Kumar V";
$data['msg'] = "Thanks for submitting your review form. It has been submitted to <Manager name> for appraisal.";
$message = $this->parser->parse("email.tpl",$data,TRUE);
$this->email->message($message);
$this->email->send();
看起来您的框架使用引用的可打印格式对邮件进行编码(所有非ascii字符将转换为=[hexnumber]),这是邮件的实际标准。请检查生成的邮件是否包含以下标题:
Content-Transfer-Encoding: quoted-printable
如果不是,那么一个“简单”的修复方法可能是将该邮件头添加到邮件中,看看这是否解决了问题。更复杂的修复方法是理解为什么框架没有添加此标题。