From f87563d75e6f7acc1f2f9c59b28e7c2153931911 Mon Sep 17 00:00:00 2001 From: Jack-Benny Persson Date: Thu, 19 Jan 2023 16:54:04 +0100 Subject: [PATCH] Fixed from- and reply-to addresses --- contact.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/contact.php b/contact.php index 3917ff1..8e3b84a 100644 --- a/contact.php +++ b/contact.php @@ -54,11 +54,10 @@ $gpg->addencryptkey($fingerprint); // Encryt the message $encrypted_message = $gpg->encrypt("Name: $name\nE-mail: $email\n\nMessage: $message"); -$headers = 'From: "Contact form" ' . "\r\n" . - 'Reply-To: info@example.com' . "\r\n" . - 'Content-Type: text/plain; charset=UTF-8' . "\r\n" . - 'X-Mailer: PHP/' . phpversion(); - +$headers = "From: \"Contact form\" <$recipient>" . "\r\n" . + "Reply-To: $email" . "\r\n" . + "Content-Type: text/plain; charset=UTF-8" . "\r\n" . + "X-Mailer: PHP/" . phpversion(); // Send the mail (this requires a fully working SMTP-server on the host) mail($recipient, $subject, $encrypted_message, $headers);