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

[HELP] email邮件发送失败。。。。求hex帮忙

[复制链接]
发表于 2012-4-25 21:36:12 | 显示全部楼层 |阅读模式
function email_send_action(){
                $uid = $_POST['uid'];
                $email_name = $_POST['email_name'];
                $email_content = $_POST['email_content'];
               
          $this->load->library('email');
      $config['protocol'] = 'smtp';
      $config['smtp_host'] = 'smtp.163.com';
      $config['smtp_user'] = '******@163.com';//这里写上你的163邮箱账户
      $config['smtp_pass'] = '*******';//这里写上你的163邮箱密码
      $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);
         
         //得到一个人的email
         $onemail = $this->AdminModel->out_one_message($uid,'email');
         
         $from_name = "合肥学院青年志愿者联合会";//发件人名称
        // $from_name = iconv('UTF-8','gb2312',$from_name);
       
         $email_subject =$email_name;
        // $email_subject = iconv('UTF-8','gb2312',$email_subject);
         
         $this->email->from('hfuuqzl@163.com',$from_name);//发件人
         
         $this->email->to($onemail);
         $this->email->subject($email_subject);
         $this->email->message($email_content);
     $this->email->send();
     if (!$this->email->send())
        {
            show_error($this->email->print_debugger());
            return false;
        }
        else
        {
            $data['message']='成功发送了一封邮件!';
                        $data['url_forward']=base_url()."index.php/admin/examined_member_list/";
                        $this->load->view('admin/showmessage',$data);
            return true;
        }
        }
本地测试正常,上传虚拟主机后显示错误,错误提示如下:
[size=0.83em]前天 22:00 上传
下载附件 [size=0.83em](23.43 KB)




是不是要开启什么socket端口。。。centos怎么开启啊???????????

发表于 2012-4-25 23:06:26 | 显示全部楼层
很明显是你的服务器连不上 smtp.163.com,检查一下服务器设置吧。

本版积分规则