Skip to content

Commit

Permalink
Update emailsend.php
Browse files Browse the repository at this point in the history
  • Loading branch information
soxft authored Sep 13, 2022
1 parent 140ea0c commit 8ab41c1
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions email/emailsend.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,13 @@
$mail->Subject = $topic;
$mail->Body = $content;
$mail->send();
$data = array(//向服务器返回token
'code' => '200'
);
$data_json = json_encode($data);
header('Content-type:text/json');
echo $data_json;
header('Content-type:text/json');
echo json_encode(["code" => "200", "msg" => "success"]);
} catch (Exception $e) {
$data = array(//向服务器返回token
'code' => 'error'
);
$data_json = json_encode($data);
header('Content-type:text/json');
echo $data_json;
}
$data = [
'code' => 'error'
];
if (DEBUG == true) $data["errMsg"] = $e->getMessage();
header('Content-type:text/json');
echo json_encode($data);
}

0 comments on commit 8ab41c1

Please sign in to comment.