Whoops! You didn't fill out the contact form properly.

Go back and try again.

END; output_card($content); die(); } $siteid = getsiteid(); $database->insert("messages", [ "siteid" => $siteid, "name" => htmlspecialchars($_POST['name']), "email" => htmlspecialchars($_POST['email']), "message" => htmlspecialchars($_POST['message']), "date" => date("Y-m-d H:i:s") ]); $content = <<Thanks!

Your message has been sent!

Continue END; output_card($content); ob_flush(); flush(); if ($database->has('settings', ["AND" => ['siteid' => $siteid, 'key' => 'contactemail']])) { $emailto = $database->get('settings', "value", ["AND" => ['siteid' => $siteid, 'key' => 'contactemail']]); // Setup mailer $mail = new PHPMailer(true); $mail->isSMTP(); $mail->Host = SMTP_HOST; $mail->SMTPAuth = SMTP_AUTH; if (SMTP_AUTH) { $mail->Username = SMTP_USERNAME; $mail->Password = SMTP_PASSWORD; } if (SMTP_SECURITY != "none") { $mail->SMTPSecure = SMTP_SECURITY; } $mail->Port = SMTP_PORT; $mail->isHTML(true); $mail->setFrom(SMTP_FROMADDRESS, SMTP_FROMNAME); $mail->addAddress($emailto); $mail->addReplyTo($_POST['email'], $_POST['name']); $mail->Subject = 'Website Contact Form Message'; $mail->Body = '

From: ' . htmlspecialchars($_POST['name']) . ' <' . $_POST['email'] . '>

' . '

Message:
' . htmlspecialchars($_POST['message']) . '

'; $mail->AltBody = "From: $_POST[name] <$_POST[email]>\r\n\r\nMessage: \r\n$_POST[message]"; $mail->send(); }