email邮件发送失败。。。。求hex帮忙
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;
}
}
本地测试正常,上传虚拟主机后显示错误,错误提示如下:
http://codeigniter.org.cn/forums/data/attachment/forum/201204/23/220009ygcy4q4lm1iyzmai.png前天 22:00 上传
下载附件 (23.43 KB)
http://codeigniter.org.cn/forums/data/attachment/forum/201204/23/220010llxfna5d0eepe05q.png
是不是要开启什么socket端口。。。centos怎么开启啊???????????
很明显是你的服务器连不上 smtp.163.com,检查一下服务器设置吧。
页:
[1]