li903986396 发表于 2014-7-8 15:32:52

PHP邮件发送已成功,中文标题乱码


   public function index()
    {
      //CI send Emaill   
      $config['protocol'] = 'smtp';
      $config['smtp_host'] = 'smtp.163.com';
      $config['smtp_user'] = 'xxxx';
      $config['smtp_pass'] = 'xxxx';
      $config['smtp_port'] = '25';
      $config['smtp_timeout'] = '10';//timeout 10s
      $config['mailtype'] = 'html';
      $config['validate'] = true;
      $config['priority'] = 1;
      $config['crlf']= "\r\n";
      $config['smtp_port'] = 25;
      $config['charset'] = 'utf-8';
      $config['wordwrap'] = TRUE;   
      $this->email->initialize($config);   
      $this->email->from('xxxx@163.com');
      $this->email->to('xxxxxx@qq.com,xxxxx@qq.com');
      $this->email->subject("邮件测试非垃圾邮件");
      $this->email->message('哈哈哈哈哈哈!成功了!');
      $this->email->send();         
      echo $this->email->print_debugger();
   

}

本地测试163邮箱 内容不会乱码,但是标题长了就会乱码。。求大神给点思路解决

li903986396 发表于 2014-7-8 15:55:47

问题已解决 去掉定义的 $config['crlf']= "\r\n"; 即可解决
页: [1]
查看完整版本: PHP邮件发送已成功,中文标题乱码