expmail/sender.php
Kumi 730ad8c0e1 Move response to own class
Implement warning output
Implement warning when URL and string provided for HTML/plain
Turn allowempty to config key
Add option to prefer URL over string for HTML/plain
Add user agent to curl requests
Update OpenAPI
Bump version to 0.5
2020-09-05 09:12:28 +02:00

30 lines
585 B
PHP

<?php
require_once 'config.php';
require_once 'Mail.class.php';
require_once 'Request.class.php';
require_once 'Response.class.php';
function handle_exception($e) {
global $res;
$res->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();