expmail/sender.php

24 lines
440 B
PHP
Raw Normal View History

2020-09-03 06:31:10 +00:00
<?php
require_once 'config.php';
require_once 'Mail.class.php';
require_once 'Request.class.php';
2020-09-03 06:31:10 +00:00
try {
$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"
);
} catch (\Exception $e) {
2020-09-03 06:31:10 +00:00
$response = array(
"status" => "error",
"error" => "{$e->getMessage()}"
);
};
echo json_encode($response);