国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.1KB

  1. <?php
  2. require_once(dirname(__FILE__)."/config.php");
  3. CheckPurview('plus_Mail');
  4. if(!isset($dopost)){
  5. $dopost = '';
  6. }
  7. if($dopost=="save"){
  8. $start = empty($start)? 1 : intval(preg_replace("/[\d]/",'', $start));
  9. $end = empty($end)? 0 : intval(preg_replace("/[\d]/",'', $end));
  10. if(!preg_match("/^[0-9a-z_]+$/i",$filename)){
  11. ShowMsg("请填写正确的文件名!","-1");
  12. exit();
  13. }
  14. if($end!="0") $wheresql="where mid between $start and $end";
  15. else $wheresql="";
  16. $sql="SELECT email FROM #@__member $wheresql";
  17. $db->Execute('me',$sql);
  18. while($row = $db->GetArray()){
  19. $mails[]=$row;
  20. }
  21. $email="";
  22. foreach($mails as $mail){
  23. $email.=$mail['email'].",";
  24. }
  25. $m_file = DEDEDATA."/mail/".$filename.".txt";
  26. if (file_exists($m_file)) {
  27. ShowMsg("该文件已经存在,重新换个文件名!","-1");
  28. exit();
  29. } else {
  30. $fp = fopen($m_file,'w');
  31. flock($fp,3);
  32. fwrite($fp,$email);
  33. fclose($fp);
  34. ShowMsg("获取邮件列表成功!","-1");
  35. exit();
  36. }
  37. }
  38. require_once(DEDEADMIN."/templets/mail_getfile.htm");
  39. ?>