handle_exception($e); } function handle_warning($errno, $errstr) { global $res; if ($res) { $res->handle_warning($errstr); } } $res = new Response(); set_exception_handler("handle_exception"); set_error_handler("handle_warning", E_USER_WARNING); $req = new Request(file_get_contents('php://input')); $mail = Mail::FromRequest($req); $mail->send(); $res->respond();