$prefix, 'domainName' => $domain ]); header('Content-Type: application/json'); echo json_encode($res); exit; } if ($action === 'emails') { $mail = trim($_POST['email'] ?? ''); $res = request(API_BASE . '/api/emails?mailbox=' . urlencode($mail)); header('Content-Type: application/json'); echo json_encode($res); exit; } if ($action === 'detail') { $id = trim($_POST['id'] ?? ''); $res = request(API_BASE . '/api/emails/' . $id); header('Content-Type: application/json'); echo json_encode($res); exit; } if ($action === 'delete') { $id = trim($_POST['id'] ?? ''); $res = request(API_BASE . '/api/emails/' . $id, 'DELETE'); header('Content-Type: application/json'); echo json_encode($res); exit; } if ($action === 'domains') { $res = request(API_BASE . '/api/domains'); header('Content-Type: application/json'); echo json_encode($res); exit; } function request($url, $method = 'GET', $data = null) { $headers = [ 'Content-Type: application/json', 'x-api-version: ' . API_VERSION ]; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); if ($method === 'POST') { curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data ?? [])); } if ($method === 'DELETE') { curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); } $resp = curl_exec($ch); curl_close($ch); return json_decode($resp, true) ?? []; } $theme = $_COOKIE['theme'] ?? 'dark'; if (isset($_GET['toggle'])) { $new = $theme === 'dark' ? 'light' : 'dark'; setcookie('theme', $new, time() + 86400 * 30); header('Location: ?'); exit; } ?> 云梦无限邮箱系统api对接界面列子2

云梦无限邮箱系统

⏳ 下次刷新:10 秒

收件箱

请先创建邮箱