0
我试图发送一封电子邮件与UTF8字符。大多数电子邮件看起来我怀疑,但随机会有垃圾字符。我相信当一个新字符插入其中一个字符的中间时,会出现垃圾字符。我怀疑CakePHP的电子邮件组件是罪魁祸首,因为它有一个功能可以根据lineLength属性插入新行。有没有什么办法解决这一问题?我正在使用CakePHP 1.3。Cakephp发送UTF-8电子邮件和lineLength
$this->Email->to = $sendEmail;
$this->Email->from = empty($this->data['Contact']['email']) ? $sendEmail : $this->data['Contact']['email'];
$this->Email->subject = $subject;
$this->Email->sendAs = 'text';
$this->Email->template = 'contact'
$this->set('fields', $this->data['Contact']);
$this->Email->charset = "utf-8";
$this->Email->headerCharset = "utf-8";
return $this->Email->send();
从电子邮件标题:
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit