2020-09-03 06:31:10 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require_once 'config.php';
|
2020-09-04 20:01:34 +00:00
|
|
|
require_once 'Mail.class.php';
|
|
|
|
require_once 'Request.class.php';
|
2020-09-05 07:12:28 +00:00
|
|
|
require_once 'Response.class.php';
|
2020-09-03 06:31:10 +00:00
|
|
|
|
2020-09-05 07:12:28 +00:00
|
|
|
function handle_exception($e) {
|
|
|
|
global $res;
|
|
|
|
$res->handle_exception($e);
|
|
|
|
}
|
2020-09-03 06:31:10 +00:00
|
|
|
|
2020-09-05 07:12:28 +00:00
|
|
|
function handle_warning($errno, $errstr) {
|
|
|
|
global $res;
|
|
|
|
if ($res) {
|
|
|
|
$res->handle_warning($errstr);
|
|
|
|
}
|
|
|
|
}
|
2020-09-03 06:31:10 +00:00
|
|
|
|
2020-09-05 07:12:28 +00:00
|
|
|
$res = new Response();
|
2020-09-03 06:31:10 +00:00
|
|
|
|
2020-09-05 07:12:28 +00:00
|
|
|
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();
|