|
- $mail_to = $mailTo!=null?$mailTo:'735830934@qq.com';
- $this->load->library('email'); //加载CI的email类
-
- //以下设置Email参数
- $config['protocol'] = 'smtp';
- $config['smtp_host'] = 'smtp.mxhichina.com';
- $config['smtp_user'] = 'no-reply@xfj100.com';
- $config['smtp_pass'] = 'XXX';
- $config['wordwrap'] = TRUE;
-
- $config['smtp_port'] = '465';
- $config['charset'] = 'utf-8';
- $config['newline'] = "\r\n";
- $config['crlf'] = "\r\n";
- $this->email->initialize($config);
-
- //以下设置Email内容
- $this->email->from('no-reply@xfj100.com', '幸福家');
- $this->email->to($mail_to);
- $this->email->subject($subject);
- $this->email->message($message);
-
- if ( $this->email->send())
- {
- log_message('error', 'success-----'.$this->email->print_debugger());
- return true;
- }else{
- log_message('error', 'fail-----'.$this->email->print_debugger());
- return false;
- }
复制代码
使用port 为465的端口,邮件午饭正常发送,使用25是正常的,因为我们的服务器是升级后阿里云的服务器,发送邮件只允许465端口,25端口不在支持,该如何配置? |
|