用户
 找回密码
 入住 CI 中国社区
搜索
查看: 2058|回复: 1
收起左侧

[控制器] PHP邮件发送已成功,中文标题乱码

[复制链接]
发表于 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邮箱 内容不会乱码,但是标题长了就会乱码。。求大神给点思路解决

 楼主| 发表于 2014-7-8 15:55:47 | 显示全部楼层
问题已解决 去掉定义的 $config['crlf']  = "\r\n"; 即可解决

本版积分规则