|
|
|
@ -123,21 +123,7 @@ class Index extends CI_Controller {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//收件人
|
|
|
|
|
$tostring = '';
|
|
|
|
|
$tolist_array = array();
|
|
|
|
|
$nowlist_array = explode(';', $this->input->post('emaillist'));
|
|
|
|
|
foreach ($nowlist_array as $v) {
|
|
|
|
|
if($v != null){
|
|
|
|
|
$tostring .= "'".$v."'".',';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$tostring = substr($tostring,0,-1);
|
|
|
|
|
if(!empty($tostring)){
|
|
|
|
|
$tolist_array = $this->ding_value_model->all_email($tostring);
|
|
|
|
|
}else{
|
|
|
|
|
$tolist_array = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$tomail = 'all@hainatravel';
|
|
|
|
|
|
|
|
|
|
//抄送
|
|
|
|
|
$ccstring = '';
|
|
|
|
@ -175,7 +161,11 @@ class Index extends CI_Controller {
|
|
|
|
|
$body = $mailheader.$this->input->post('emailcontent');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!$this->do_sendmail($fromuser, $tolist_array, $cclist_array, $subject, $body)) {
|
|
|
|
|
//提交到其他服务器发送
|
|
|
|
|
$url = 'https://cht.mycht.cn/webht.php/apps/dingmail/index/do_sendmail'.$fromuser.'/'.$tomail.'/'.$subject.'/'.$body;
|
|
|
|
|
$flag = $this->get_http($url);
|
|
|
|
|
|
|
|
|
|
if (!$flag) {
|
|
|
|
|
$result = 0; //"邮件发送有误: " . $mail->ErrorInfo;
|
|
|
|
|
} else {
|
|
|
|
|
//是value邮件的话,默认发送人点赞
|
|
|
|
@ -238,11 +228,9 @@ class Index extends CI_Controller {
|
|
|
|
|
// $mailnody .= '任职时间开始:'.$data['from_time'].'<br>';
|
|
|
|
|
// $mailnody .= '任职时间结束:'.$data['to_time'].'<br>';
|
|
|
|
|
|
|
|
|
|
$tolist_array = array();
|
|
|
|
|
$tolist_array['0'] = new stdClass();
|
|
|
|
|
$tolist_array['0']->ddu_Email = 'hr@chinahighlights.net';
|
|
|
|
|
$tomail = 'hr@chinahighlights.net';
|
|
|
|
|
|
|
|
|
|
if($this->do_sendmail('cyc',$tolist_array,'','应聘简历',$mailnody)){
|
|
|
|
|
if($this->do_sendmail('cyc',$tomail,'应聘简历',$mailnody)){
|
|
|
|
|
echo '{"status":1}';
|
|
|
|
|
}else{
|
|
|
|
|
echo '{"status":0}';
|
|
|
|
@ -250,8 +238,8 @@ class Index extends CI_Controller {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//执行邮件发送功能
|
|
|
|
|
public function do_sendmail($fromuser, $tolist_array, $cclist_array, $subject, $mailbody) {
|
|
|
|
|
/*$this->load->library('Phpmailer_lib');
|
|
|
|
|
public function do_sendmail($fromuser, $tomail, $subject, $mailbody) {
|
|
|
|
|
$this->load->library('Phpmailer_lib');
|
|
|
|
|
$mail = new PHPMailer();
|
|
|
|
|
$mail->IsSMTP();
|
|
|
|
|
$mail->Host = 'smtp.mxhichina.com';//smtp.sendgrid.net
|
|
|
|
@ -277,16 +265,7 @@ class Index extends CI_Controller {
|
|
|
|
|
$mail->From = 'admin@hainatravel.com'; //发件人
|
|
|
|
|
//$mail->setFrom('zm198311@yahoo.com.cn', $fromuser);
|
|
|
|
|
|
|
|
|
|
if($tolist_array != null){
|
|
|
|
|
foreach ($tolist_array as $v) {
|
|
|
|
|
$mail->AddAddress($v->ddu_Email); //收件人
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if($cclist_array != null){
|
|
|
|
|
foreach ($cclist_array as $c) {
|
|
|
|
|
$mail->addCC($c->ddu_Email); //抄送
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$mail->AddAddress($tomail);
|
|
|
|
|
|
|
|
|
|
$mail->Subject = $subject; //邮件主题
|
|
|
|
|
$mail->Body = $mailbody; //邮件内容
|
|
|
|
@ -297,9 +276,9 @@ class Index extends CI_Controller {
|
|
|
|
|
} else {
|
|
|
|
|
$result = true;
|
|
|
|
|
}
|
|
|
|
|
return $result;*/
|
|
|
|
|
require 'email.class.php';
|
|
|
|
|
$mailto = 'admin@hainatravel.com';
|
|
|
|
|
return $result;
|
|
|
|
|
/*require 'email.class.php';
|
|
|
|
|
$mailto = 'all@hainatravel.com';
|
|
|
|
|
$mailsubject = $subject;
|
|
|
|
|
$mailbody = $mailbody;
|
|
|
|
|
$smtpserver = "smtp.qiye.aliyun.com";
|
|
|
|
@ -320,12 +299,12 @@ class Index extends CI_Controller {
|
|
|
|
|
$additional_headers = "";
|
|
|
|
|
//设置发件人名称,名称用户可以自定义填写。
|
|
|
|
|
$sender = "发件人";
|
|
|
|
|
$smtp->sendmail($mailto,$smtpusermail, $mailsubject, $mailbody, $mailtype, $cc, $bcc, $additional_headers, $sender, $smtpreplyto);
|
|
|
|
|
$smtp->sendmail($mailto,$smtpusermail, $mailsubject, $mailbody, $mailtype, $cc, $bcc, $additional_headers, $sender, $smtpreplyto);*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function do_sendmailtest() {
|
|
|
|
|
require 'email.class.php';
|
|
|
|
|
$mailto = 'admin@hainatravel.com';
|
|
|
|
|
$mailto = 'cyc@hainatravel.com';
|
|
|
|
|
$mailsubject = '测试标题';
|
|
|
|
|
$mailbody = '测试内容';
|
|
|
|
|
$smtpserver = "smtp.qiye.aliyun.com";
|
|
|
|
|