. */ require_once(__DIR__ . '/../login-ajax.php'); try { $_offer = new Offer($_pdo, $_REQUEST['id']); $_mailer = $_offer->mailer(); } catch (Exception $e) { http_response_code(500); die($e->getMessage()); } function format_email($address) { if ($address[1] != '') { return "{$address[1]} <{$address[0]}>"; } else { return $address[0]; } } if ($_SERVER['REQUEST_METHOD'] === 'GET') { ?>
getReplyToAddresses() as $addr) { ?>
getBccAddresses() as $addr) { ?>
getCcAddresses() as $addr) { ?>
getToAddresses() as $addr) { ?>
Subject = $_POST['subject']; $_mailer->Body = $_POST['body']; try { if ($_mailer->send()) { echo 'OK'; } else { http_response_code(500); echo 'Sending the email failed:
' . $_mailer->ErrorInfo; } } catch (Exception $e) { http_response_code(500); echo "Sending the email failed with an exception ({$e->getCode()}): {$e->getMessage()}
" . $e->getTraceAsString(); } }