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-03 06:31:10 +00:00
|
|
|
|
|
|
|
try {
|
2020-09-04 20:01:34 +00:00
|
|
|
$req = new Request(file_get_contents('php://input'));
|
|
|
|
$mail = Mail::FromRequest($req);
|
|
|
|
$mail->send();
|
2020-09-03 06:31:10 +00:00
|
|
|
|
|
|
|
$response = array(
|
|
|
|
"status" => "success"
|
|
|
|
);
|
|
|
|
|
2020-09-04 13:09:39 +00:00
|
|
|
} catch (\Exception $e) {
|
2020-09-03 06:31:10 +00:00
|
|
|
$response = array(
|
|
|
|
"status" => "error",
|
|
|
|
"error" => "{$e->getMessage()}"
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
echo json_encode($response);
|