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

[HELP] 关于CI邮箱发送的问题

[复制链接]
发表于 2013-7-8 21:22:01 | 显示全部楼层 |阅读模式
报错::
电子邮件()的[function.mail]:在“localhost”的25端口无法连接到邮件服务器,验证您的“SMTP”和“smtp_port”的设定在php.ini或使用手册中ini_set()


email.php
                         $config['protocol'] = 'SMTP';
                        $config['smtp_host'] = 'smtp.163.com';
                        $config['smtp_user'] = 'xxxxxxx@163.com';
                        $config['smtp_pass'] = 'xxxxxxxxxx';
                        $config['mailtype'] = 'html';
                        $config['validate'] = true;
                        $config['priority'] = 1;
                        $config['wordwrap'] = TRUE;
                        $config['charset'] = 'utf-8';







class Message extends CI_Controller{

                        public function index(){
                                        $this->load->library('email');
                                       

                                        //$this->email->initialize($config);       
                                        $this->email->from('xxxxx@163.com', '管理员');
                                        $this->email->to('xxxxxx@qq.com');
                                       
                                        $this->email->subject('Email Test');
                                        $this->email->message('Testing the email class.');
                                        $this->email->send();
                                       
                                        //echo $this->email->print_debugger();

                                       

                                }
                        }       


这都没错,而且去看163.qq的 SMTP都是开着的,为什么会报这样的错,求解.谢谢.
[img]file:///C:\Users\admin\AppData\Roaming\Tencent\Users\252069993\QQ\WinTemp\RichOle\M9N%[J22IA6EB@QYIX6(LEH.jpg[/img]
[img]file:///C:\Users\admin\AppData\Roaming\Tencent\Users\252069993\QQ\WinTemp\RichOle\M9N%[J22IA6EB@QYIX6(LEH.jpg[/img]


发表于 2013-7-9 09:09:12 | 显示全部楼层
PHP复制代码
$config['protocol'] = 'smtp';
复制代码
 楼主| 发表于 2013-7-9 14:21:04 | 显示全部楼层
qi_ruo 发表于 2013-7-9 09:09

嗯,谢谢哈,不过改这个没什么效果.问了好多人,之后决然的放弃了,等有时间在研究.
我直接加载了一个插件phpmailer 然后就OK了.

貌似很多人都不用CI 自带的mai类的.很多问题的说.
发表于 2013-7-9 16:55:49 | 显示全部楼层

本版积分规则