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

[Others] 邮件发送问题

[复制链接]
发表于 2008-1-28 17:13:15 | 显示全部楼层 |阅读模式
我做了一个测试网站 但是邮件发送后始终接受不到 请问是甚么原因?
发表于 2008-1-28 17:39:28 | 显示全部楼层
请问你使用的是什么邮件发送方式?
发表于 2008-1-29 10:42:17 | 显示全部楼层
PHP复制代码
    function mail(){
        /*
                mail config
                */

                $config['protocol'] = 'smtp';//采用smtp方式,方便租用主机的用户
                $config['smtp_host'] = 'smtp.126.com';
                $config['smtp_user'] = 'mytest4126';//邮箱帐号为mytest4126@126.com
                $config['smtp_pass'] = '******';
                //$config['charset'] = 'iso-8859-1';
                $config['charset'] = 'utf-8';
                $config['wordwrap'] = TRUE;
                $config['mailtype'] = "html";
               
        $this->load->library('email');
        $this->email->initialize($config);
                $this->email->from('mytest4126@126.com', '我是发件人');
                $this->email->to('foreveronline@163.com');//收件人
                $this->email->subject('中文主题');
                $this->email->message('这是中文的正文部分.');
 
                if(!$this->email->send())
                {
                show_error("发送mail时,发生错误!");
                //echo $this->email->print_debugger();
                exit;
                }
    }
复制代码

本版积分规则