Adding two config options to modify behavior Allow messages with empty body to be sent Automatically convert HTML to plain if none provided Version bump to 0.4
23 lines
440 B
PHP
23 lines
440 B
PHP
<?php
|
|
|
|
require_once 'config.php';
|
|
require_once 'Mail.class.php';
|
|
require_once 'Request.class.php';
|
|
|
|
try {
|
|
$req = new Request(file_get_contents('php://input'));
|
|
$mail = Mail::FromRequest($req);
|
|
$mail->send();
|
|
|
|
$response = array(
|
|
"status" => "success"
|
|
);
|
|
|
|
} catch (\Exception $e) {
|
|
$response = array(
|
|
"status" => "error",
|
|
"error" => "{$e->getMessage()}"
|
|
);
|
|
};
|
|
|
|
echo json_encode($response);
|