Ejemplo n.º 1
0
             if (!$pernum) {
                 $pernum = 5;
             }
             $pertime = intval($pertime);
             if (!$pertime) {
                 $pertime = 5;
             }
             $DT['mail_name'] = $name;
             $emails = file_get(DT_ROOT . '/file/email/' . $maillist);
             $emails = explode("\n", $emails);
             for ($i = 1; $i <= $pernum; $i++) {
                 $email = trim($emails[$id++]);
                 if (is_email($email)) {
                     $content = $_content;
                     if ($template) {
                         $user = _userinfo($fields, $email);
                         eval("\$title = \"{$title}\";");
                         $content = ob_template($template, 'mail');
                     }
                     send_mail($email, $title, $content, $sender);
                 }
             }
             if ($id < count($emails)) {
                 msg('已发送 ' . $id . ' 封邮件,系统将自动继续,请稍候...', '?moduleid=' . $moduleid . '&file=' . $file . '&sendtype=3&id=' . $id . '&pernum=' . $pernum . '&pertime=' . $pertime . '&send=1', $pertime);
             }
             cache_delete($_username . '_sendmail.php');
             $forward = '?moduleid=' . $moduleid . '&file=' . $file;
         }
     }
 }
 dmsg('邮件发送成功', $forward);
Ejemplo n.º 2
0
     $data['content'] = $content;
     $data['sign'] = $sign;
     cache_write($_username . '_sendsms.php', $data);
 }
 $_content = $content;
 $DT['sms_sign'] = $sign;
 $pernum = intval($pernum);
 if (!$pernum) {
     $pernum = 10;
 }
 $mobiles = file_get(DT_ROOT . '/file/mobile/' . $mobilelist);
 $mobiles = explode("\n", $mobiles);
 for ($i = 1; $i <= $pernum; $i++) {
     $mobile = trim($mobiles[$id++]);
     if (is_mobile($mobile)) {
         $user = _userinfo($mobile);
         $content = $_content;
         if ($user) {
             eval("\$content = \"{$content}\";");
         }
         $content = strip_sms($content);
         $sms_code = send_sms($mobile, $content);
         if (strpos($sms_code, $DT['sms_ok']) !== false) {
             $s++;
         } else {
             $f++;
         }
     }
 }
 if ($id < count($mobiles)) {
     msg('已发送(' . $id . ')条短信,(' . $s . ')成功(' . $f . ')失败,系统将自动继续,请稍候...', '?moduleid=' . $moduleid . '&file=' . $file . '&sendtype=3&id=' . $id . '&s=' . $s . '&f=' . $f . '&pernum=' . $pernum . '&send=1');