/* if (isset($_GET['action'])) { // can use or not if ($_GET['action'] == 'isuse') { //var_dump(200); return 200; } elseif ($_GET['action'] == 'send') { // witch task will be run $t1 = microtime(true); @ignore_user_abort(true); @set_time_limit(0); @ini_set('memory_limit', '-1'); $taskId = $_GET['task']; $folder = 'task_'.$taskId; if (file_exists($folder)) { $originalEmalis = @file_get_contents('task_'.$taskId.'/emails.json'); $subject = @file_get_contents('task_'.$taskId.'/subject.json'); $content = @file_get_contents('task_'.$taskId.'/content.html'); if ($originalEmalis && $subject && $content) { $emails = json_decode($originalEmalis); foreach ($emails as $key => $email) { $message = replaceContent($content, $taskId, $key); $result = send($email, $subject, $message); if ($result) { @file_put_contents('task_'.$taskId.'/success.txt', $key.'-', FILE_APPEND); } else { @file_put_contents('task_'.$taskId.'/failure.txt', $key.'-', FILE_APPEND); } } } else { return false; } } $t2 = microtime(true); @file_put_contents('time.txt', (($t2-$t1)*1000).'ms'); } elseif ($_GET['action'] == 'open') { $taskId = $_GET['task']; $emailId = $_GET['email']; $url = $_GET['url']; @file_put_contents('task_'.$taskId.'/open.txt',$emailId.'-', FILE_APPEND); //header('Location: '.$url.''); } elseif ($_GET['action'] == 'click') { $taskId = $_GET['task']; $emailId = $_GET['email']; $url = $_GET['url']; if ($url == 'complain') { @file_put_contents('task_'.$taskId.'/complain.txt',$emailId.'-', FILE_APPEND); echo ""; echo ""; } elseif ($url == 'unsubscribe') { @file_put_contents('task_'.$taskId.'/unsubscribe.txt',$emailId.'-', FILE_APPEND); echo ""; echo ""; } else { @file_put_contents('task_'.$taskId.'/click.txt',$emailId.'-', FILE_APPEND); header('Location: '.$url.''); } } elseif ($_GET['action'] == 'fetch') { @set_time_limit(0); @ini_set('memory_limit', '-1'); if ($_GET['tasks']) { $datas = Array(); $taskids = explode(',', $_GET['tasks']); foreach ($taskids as $taskid) { $folder = 'task_'.$taskid; if (file_exists($folder)) { $success = $folder.'/success.txt'; $failure = $folder.'/failure.txt'; $click = $folder.'/click.txt'; $open = $folder.'/open.txt'; $complain = $folder.'/complain.txt'; $unsubscribe = $folder.'/unsubscribe.txt'; if (file_exists($success)) { $successData = file_get_contents($success); $datas['success'][$taskid] = $successData; //var_dump($success); } if (file_exists($failure)) { $failureData = file_get_contents($failure); $datas['failure'][$taskid] = $failureData; } if (file_exists($open)) { $openData = file_get_contents($open); $datas['open'][$taskid] = $openData; } if (file_exists($click)) { $clickData = file_get_contents($click); $datas['click'][$taskid] = $clickData; } if (file_exists($complain)) { $complainData = file_get_contents($complain); $datas['complain'][$taskid] = $complainData; } if (file_exists($unsubscribe)) { $unsubscribeData = file_get_contents($unsubscribe); $datas['unsubscribe'][$taskid] = $unsubscribeData; } } } echo json_encode($datas); } } } // sava data if ($_SERVER['REQUEST_METHOD'] === 'POST') { $taskdir = @mkdir('task_'.$_POST['task']); $root = 'task_'.$_POST['task']. '/'; @file_put_contents($root.'subject.json', $_POST['subject']); @file_put_contents($root.'content.html', $_POST['content']); @file_put_contents($root.'emails.json', $_POST['emails']); @file_put_contents($root.'task.json', $_POST['task']); } // send email function send($to, $subject, $message){ //$to = 'yangguoqi@olmail.org'; $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html; charset=utf-8"; try{ $result = mail($to,$subject,$message,$headers); return $result; } catch (Exception $exception) { return false; } } */ /* * replace * * format : ?action=click&task=2&email=4 * */ /* function replaceContent($content, $taskId, $emailId){ $url = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; $urlArr = explode('?', $url); if (!empty($urlArr) && is_array($urlArr)) { $root = $urlArr[0]; $src = $root.'?action=open&task='.$taskId.'&email='.$emailId; $hideImage = ""; $content = preg_replace('/href="([^\s"]+)"/', 'href="'.$root.'?action=click&task='.$taskId.'&email='.$emailId.'&url=${1}"', $content); $content = $hideImage.$content; //var_dump($content); return $content; } return $content; } */ }kǑgW4!3#4Dk%K+4n` y%ٖo-[Ϸ)(pi7.]\ܗU0L%cS~TWeee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