success){ }else{ }*/ if ($_POST['name'] != null && $_POST['email'] != null && $_POST['phone'] && $_POST['message'] != null) { try { //Server settings $mail->SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output $mail->isSMTP(); //Send using SMTP $mail->Host = 'box.luke-else.co.uk'; //Set the SMTP server to send through $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; //Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged $mail->Port = 587; //TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above //Recipients $mail->setFrom('enquiries@snexo.co.uk'); $mail->addAddress('enquiries@snexo.co.uk'); //Add a recipient //Content $mail->isHTML(true); //Set email format to HTML $mail->Subject = 'Website Contact Form: ' . $_POST['email']; $mail->Body = '
Name: ' . $_POST['name'] . '
E-Mail: ' . $_POST['email'] . '
Phone Number: ' . $_POST['phone'] . '

Message:
' . $_POST['message']; $mail->send(); } catch (Exception $e) { http_response_code(500); } }else{ http_response_code(500); } ?>