From 2b4a14e965ed3e9176a9a0e013ce92569e80cb9a Mon Sep 17 00:00:00 2001 From: Anxhelo Lushka Date: Thu, 15 Mar 2018 17:50:42 +0100 Subject: [PATCH] Update and rename request.html to request.php --- request.html => request.php | 50 ++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) rename request.html => request.php (61%) diff --git a/request.html b/request.php similarity index 61% rename from request.html rename to request.php index cae41ed..a3f82be 100644 --- a/request.html +++ b/request.php @@ -2,6 +2,54 @@ layout: default section_id: contact --- + +isSMTP(); + $mail->Host = 'localhost'; + $mail->Port = 25; + //Use a fixed address in your own domain as the from address + //**DO NOT** use the submitter's address here as it will be forgery + //and will cause your messages to fail SPF checks + $mail->setFrom('team@ura.design', 'Ura Design'); + //Send the message to yourself, or whoever should receive contact for submissions + $mail->addAddress('anxhelo1995@gmail.com', 'Anxhelo Lushka'); + //Put the submitter's address in a reply-to header + //This will fail if the address provided is invalid, + //in which case we should ignore the whole request + if ($mail->addReplyTo($_POST['email'], $_POST['name'])) { + $mail->Subject = 'PHPMailer contact form'; + //Keep it simple - don't use HTML + $mail->isHTML(false); + //Build a simple message body + $mail->Body = <<send()) { + //The reason for failing to send will be in $mail->ErrorInfo + //but you shouldn't display errors to users - process the error, log it on your server. + $msg = 'Sorry, something went wrong. Please try again later.'; + } else { + $msg = 'Message sent! Thanks for contacting us.'; + } + } else { + $msg = 'Invalid email address, message ignored.'; + } +} +?> +
@@ -13,7 +61,7 @@ section_id: contact
-
+

Thanks for contacting us, we'll be in touch soon!