修改程序

mobile-first
cyc 5 years ago
parent 0267cb8562
commit 40c81f3c49

@ -126,6 +126,7 @@ class Index extends CI_Controller {
$tostring = '';
$tostring = substr($data['mail_touser'],0,-1);
$tostring = "'".$tostring."'";
if(!empty($tostring)){
$tomail = $this->ding_value_model->all_email($tostring);
@ -133,68 +134,52 @@ class Index extends CI_Controller {
$tomail = null;
}
//抄送
$ccstring = '';
$cclist_array = array();
$ccmail_array = explode(';', $this->input->post('cs_emaillist'));
foreach ($ccmail_array as $c) {
if($c != null){
$ccstring .= "'".$c."'".',';
}
}
$ccstring = substr($ccstring,0,-1);
if(!empty($ccstring)){
$cclist_array = $this->ding_value_model->all_email($ccstring);
}else{
$cclist_array = null;
}
$mailheader = '<p style="font-size:20px">FROM:'.$user_info->ddu_Name.'</p><br>';
$mailbody = '<div style="overflow:hidden">
<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" >
<img src="http://' . $_SERVER['HTTP_HOST'] . '/css/images/unlike.png" />
</a>
</div>';
$fromuser = $user_info->ddu_Name;
$subject = $this->input->post('mail_subject');
//是否为value邮件如果不是value邮件不在邮件下放置点赞按钮
if($this->input->post('whum_value_user')){
$body = $mailheader.$this->input->post('emailcontent').$mailbody;
}else{
$body = $mailheader.$this->input->post('emailcontent');
}
//提交到其他服务器发送
$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邮件的话默认发送人点赞
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);
}
$mailheader = '<p style="font-size:20px">FROM:'.$user_info->ddu_Name.'</p><br>';
$mailbody = '<div style="overflow:hidden">
<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" >
<img src="http://' . $_SERVER['HTTP_HOST'] . '/css/images/unlike.png" />
</a>
</div>';
$fromuser = $user_info->ddu_Name;
$subject = $this->input->post('mail_subject');
//是否为value邮件如果不是value邮件不在邮件下放置点赞按钮
if($this->input->post('whum_value_user')){
$body = $mailheader.$this->input->post('emailcontent').$mailbody;
}else{
$body = $mailheader.$this->input->post('emailcontent');
}
//提交到其他服务器发送
$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邮件的话默认发送人点赞
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;
return;
$result = 1;
}
echo $result;
return;
}
//ajax发送邮件

Loading…
Cancel
Save