$id, "app_secret" => $secret]); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $payload); $response = json_decode(curl_exec($ch), true); curl_close($ch); return $response['tenant_access_token'] ?? null; } // --- 核心逻辑:API 发信 --- if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['send_mail'])) { $token = getFeishuToken($appId, $appSecret); if ($token) { $url = "https://open.feishu.cn/open-apis/mail/v1/messages"; $data = [ "from" => ["address" => "anon@mygo.live"], // 请确保此公共邮箱已在飞书后台激活 "to" => [["address" => $_POST['to']]], "subject" => $_POST['subject'], "content" => $_POST['content'] ]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, [ "Authorization: Bearer $token", "Content-Type: application/json; charset=utf-8" ]); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); $res = json_decode(curl_exec($ch), true); curl_close($ch); $msg = ($res['code'] === 0) ? "邮件已传达至迷途的那方。" : "发送失败:" . ($res['msg'] ?? "未知重力异常"); } } ?> MyGO!!!!! | 邮件中心

MyGO!!!!!

MAIL TERMINAL
POWERED BY RAINYUN EPYC & FEISHU API