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

[HELP] 使用CI自带的邮件类库发送邮件对PHP配置有要求吗?

[复制链接]
发表于 2011-8-15 21:06:32 | 显示全部楼层 |阅读模式
本帖最后由 phoenixg 于 2011-8-15 21:07 编辑

标题就是问题

 楼主| 发表于 2011-8-15 21:24:05 | 显示全部楼层
对了顺便问下,为什么这样设置发不出去邮件:
home.php控制器:
PHP复制代码
 
    public function sendsecretmail()
    {
        //加载页头
        $data['login'] = $this->data['login'];
        $this->load->view('includes/v_header',$data);
       
        $this->load->library('email');
       
        $config['useragent'] = 'CodeIgniter';//用户代理
        $config['protocol'] = 'smtp';//邮件发送协议mail, sendmail, or smtp
        $config['smtp_host'] = 'smtp.qq.com';
        $config['smtp_user'] = '我的qq号@qq.com';
        $config['smtp_pass'] = '我的密码';
        $config['smtp_port'] = 25;
        $config['smtp_timeout'] = 5;
        $config['wordwrap'] = TRUE;
        $config['mailtype'] = 'html';
        $config['charset'] = 'utf-8';
        $config['validate'] = TRUE;
       
        $this->email->initialize($config);
       
        $this->email->from('我的qq号@qq.com', '我的昵称');
        $this->email->to('我的qq号@qq.com');
       
        $this->email->subject('Email Test');
        $this->email->message('Testing the email class.');
       
        $this->email->send();
       
        echo $this->email->print_debugger();
       
        //加载页脚
        $this->load->view('includes/v_footer');
    }
 
 
复制代码


发表于 2011-9-19 20:38:00 | 显示全部楼层
发邮件,弄不懂
发表于 2011-9-19 20:42:17 | 显示全部楼层
页面打印出来什么内容啊
发表于 2011-9-19 23:22:06 | 显示全部楼层
发邮件需要服务器支持的,
发表于 2011-9-24 11:43:39 | 显示全部楼层
检查设置,是否开启了SMTP

QQ邮箱设置-账户

QQ邮箱设置-账户

本版积分规则