SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output $mail->isSMTP(); //Send using SMTP $mail->Host = 'dlinux.mail'; //Set the SMTP server to send through $mail->SMTPAuth = true; //Enable SMTP authentication $mail->Username = 'username@dlinux.mail'; //SMTP username $mail->Password = 'passwordhere'; //SMTP password $mail->SMTPSecure = false; $mail->SMTPAutoTLS = false; // $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; //Enable implicit TLS encryption $mail->Port = 25; //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS` //Recipients $mail->setFrom('from@example.com', 'Website Contact'); $mail->addAddress('to@dlinux.mail', 'Username'); //Add a recipien $mail->addReplyTo('info@example.com', 'Information'); //Content $mail->isHTML(true); //Set email format to HTML $mail->Subject = $_POST['subject'];; $mail->Body = $_POST['text'];; $mail->send(); echo ''; header('Location: https://domain.tld/contact_complete.html'); exit(); echo 'Message has been sent'; } catch (Exception $e) { echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}"; }