diff --git a/content/misc/contact.php b/content/misc/contact.php index 1d9b35c..14a64e2 100644 --- a/content/misc/contact.php +++ b/content/misc/contact.php @@ -38,7 +38,9 @@ $mailContents = [ 'subject' => 'Diese Nachricht kam ueber das Kontaktformular von t-r.de', 'bodyText' => implode("\n\n", $body), 'fromAddress' => $general['notificationAddress'], - 'fromName' => 'Tobias Radloffs Kontaktformular' + 'fromName' => 'Tobias Radloffs Kontaktformular', + 'replyTo' => $_POST['email'], + 'name' => $_POST['name'] ]; try { diff --git a/content/misc/functions.php b/content/misc/functions.php index 39e9d54..fb1e015 100644 --- a/content/misc/functions.php +++ b/content/misc/functions.php @@ -64,6 +64,11 @@ function SendEmail($toAddress, $mailContents) { // recipient $mail->addAddress($toAddress); + // reply-to address + if ( isset($mailContents['replyTo']) and isset($mailContents['name']) ) { + $mail->addReplyTo($mailContents['replyTo'], $mailContents['name']); + } + // content $mail->CharSet = 'UTF-8'; if ( isset($mailContents['bodyHTML']) and $mailContents['bodyHTML'] != '' ) {