SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output $mail->isSMTP(); //Send using SMTP $mail->Host = 'in-v3.mailjet.com'; //Set the SMTP server to send through $mail->SMTPAuth = true; $mail->Username = ''; $mail->Password = ''; $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('contact@luke-else.co.uk'); $mail->addAddress('contact@luke-else.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'] . '

Message:
' . $_POST['message']; $mail->send(); } catch (Exception $e) { // error_log($e); // echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}"; http_response_code(500); } }else{ http_response_code(500); } ?>