|
|
@ -126,6 +126,7 @@ class Index extends CI_Controller {
|
|
|
|
$tostring = '';
|
|
|
|
$tostring = '';
|
|
|
|
|
|
|
|
|
|
|
|
$tostring = substr($data['mail_touser'],0,-1);
|
|
|
|
$tostring = substr($data['mail_touser'],0,-1);
|
|
|
|
|
|
|
|
$tostring = "'".$tostring."'";
|
|
|
|
|
|
|
|
|
|
|
|
if(!empty($tostring)){
|
|
|
|
if(!empty($tostring)){
|
|
|
|
$tomail = $this->ding_value_model->all_email($tostring);
|
|
|
|
$tomail = $this->ding_value_model->all_email($tostring);
|
|
|
@ -133,68 +134,52 @@ class Index extends CI_Controller {
|
|
|
|
$tomail = null;
|
|
|
|
$tomail = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//抄送
|
|
|
|
$mailheader = '<p style="font-size:20px">FROM:'.$user_info->ddu_Name.'</p><br>';
|
|
|
|
$ccstring = '';
|
|
|
|
$mailbody = '<div style="overflow:hidden">
|
|
|
|
$cclist_array = array();
|
|
|
|
<a style="height:auto;text-decoration: none;" href="http://' . $_SERVER['HTTP_HOST'] . '/webht.php/apps/dingmail/index/like/' . $data['mail_identify'] . '/like" >
|
|
|
|
$ccmail_array = explode(';', $this->input->post('cs_emaillist'));
|
|
|
|
<img src="http://' . $_SERVER['HTTP_HOST'] . '/css/images/like.png" />
|
|
|
|
|
|
|
|
</a>
|
|
|
|
foreach ($ccmail_array as $c) {
|
|
|
|
<a style="height:auto;text-decoration: none;" href="http://' . $_SERVER['HTTP_HOST'] . '/webht.php/apps/dingmail/index/like/' . $data['mail_identify'] . '/unlike" >
|
|
|
|
if($c != null){
|
|
|
|
<img src="http://' . $_SERVER['HTTP_HOST'] . '/css/images/unlike.png" />
|
|
|
|
$ccstring .= "'".$c."'".',';
|
|
|
|
</a>
|
|
|
|
}
|
|
|
|
</div>';
|
|
|
|
}
|
|
|
|
|
|
|
|
$ccstring = substr($ccstring,0,-1);
|
|
|
|
$fromuser = $user_info->ddu_Name;
|
|
|
|
if(!empty($ccstring)){
|
|
|
|
$subject = $this->input->post('mail_subject');
|
|
|
|
$cclist_array = $this->ding_value_model->all_email($ccstring);
|
|
|
|
|
|
|
|
}else{
|
|
|
|
//是否为value邮件,如果不是value邮件,不在邮件下放置点赞按钮
|
|
|
|
$cclist_array = null;
|
|
|
|
if($this->input->post('whum_value_user')){
|
|
|
|
}
|
|
|
|
$body = $mailheader.$this->input->post('emailcontent').$mailbody;
|
|
|
|
$mailheader = '<p style="font-size:20px">FROM:'.$user_info->ddu_Name.'</p><br>';
|
|
|
|
}else{
|
|
|
|
$mailbody = '<div style="overflow:hidden">
|
|
|
|
$body = $mailheader.$this->input->post('emailcontent');
|
|
|
|
<a style="height:auto;text-decoration: none;" href="http://' . $_SERVER['HTTP_HOST'] . '/webht.php/apps/dingmail/index/like/' . $data['mail_identify'] . '/like" >
|
|
|
|
}
|
|
|
|
<img src="http://' . $_SERVER['HTTP_HOST'] . '/css/images/like.png" />
|
|
|
|
|
|
|
|
</a>
|
|
|
|
//提交到其他服务器发送
|
|
|
|
<a style="height:auto;text-decoration: none;" href="http://' . $_SERVER['HTTP_HOST'] . '/webht.php/apps/dingmail/index/like/' . $data['mail_identify'] . '/unlike" >
|
|
|
|
$url = 'https://cht.mycht.cn/webht.php/apps/dingmail/index/do_sendmail'.$fromuser.'/'.$tomail.'/'.$subject.'/'.$body;
|
|
|
|
<img src="http://' . $_SERVER['HTTP_HOST'] . '/css/images/unlike.png" />
|
|
|
|
$flag = $this->get_http($url);
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</div>';
|
|
|
|
if (!$flag) {
|
|
|
|
|
|
|
|
$result = 0; //"邮件发送有误: " . $mail->ErrorInfo;
|
|
|
|
$fromuser = $user_info->ddu_Name;
|
|
|
|
} else {
|
|
|
|
$subject = $this->input->post('mail_subject');
|
|
|
|
//是value邮件的话,默认发送人点赞
|
|
|
|
|
|
|
|
if ($this->input->post('whum_value_user')) {
|
|
|
|
//是否为value邮件,如果不是value邮件,不在邮件下放置点赞按钮
|
|
|
|
$obj = explode(';', $this->input->post('whum_value_user'));
|
|
|
|
if($this->input->post('whum_value_user')){
|
|
|
|
foreach(array_filter($obj) as $value){
|
|
|
|
$body = $mailheader.$this->input->post('emailcontent').$mailbody;
|
|
|
|
$data['comment_name'] = $value;
|
|
|
|
}else{
|
|
|
|
$data['comment_unionid'] = $this->ding_value_model->get_dingding_unionid($data['comment_name'])->ddu_Unionid;
|
|
|
|
$body = $mailheader.$this->input->post('emailcontent');
|
|
|
|
$data['type'] = 'like';
|
|
|
|
}
|
|
|
|
$data['mail_identify'] = $data['mail_identify'];
|
|
|
|
|
|
|
|
$data['user'] = $user_info->ddu_Name;
|
|
|
|
//提交到其他服务器发送
|
|
|
|
$data['user_unionid'] = $user_info->ddu_Unionid;
|
|
|
|
$url = 'https://cht.mycht.cn/webht.php/apps/dingmail/index/do_sendmail'.$fromuser.'/'.$tomail.'/'.$subject.'/'.$body;
|
|
|
|
$data['content'] = $this->ding_value_model->get_mail($data['mail_identify'])->ddm_Content;
|
|
|
|
$flag = $this->get_http($url);
|
|
|
|
$data['createtime'] = time();
|
|
|
|
|
|
|
|
$whc_id = $this->ding_value_model->add_value($data);
|
|
|
|
if (!$flag) {
|
|
|
|
|
|
|
|
$result = 0; //"邮件发送有误: " . $mail->ErrorInfo;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
//是value邮件的话,默认发送人点赞
|
|
|
|
|
|
|
|
if ($this->input->post('whum_value_user')) {
|
|
|
|
|
|
|
|
$obj = explode(';', $this->input->post('whum_value_user'));
|
|
|
|
|
|
|
|
foreach(array_filter($obj) as $value){
|
|
|
|
|
|
|
|
$data['comment_name'] = $value;
|
|
|
|
|
|
|
|
$data['comment_unionid'] = $this->ding_value_model->get_dingding_unionid($data['comment_name'])->ddu_Unionid;
|
|
|
|
|
|
|
|
$data['type'] = 'like';
|
|
|
|
|
|
|
|
$data['mail_identify'] = $data['mail_identify'];
|
|
|
|
|
|
|
|
$data['user'] = $user_info->ddu_Name;
|
|
|
|
|
|
|
|
$data['user_unionid'] = $user_info->ddu_Unionid;
|
|
|
|
|
|
|
|
$data['content'] = $this->ding_value_model->get_mail($data['mail_identify'])->ddm_Content;
|
|
|
|
|
|
|
|
$data['createtime'] = time();
|
|
|
|
|
|
|
|
$whc_id = $this->ding_value_model->add_value($data);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$result = 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
echo $result;
|
|
|
|
$result = 1;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
echo $result;
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//ajax发送邮件
|
|
|
|
//ajax发送邮件
|
|
|
|