From 9a2257958f77e293a6f49d741405521f02855896 Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 24 Jul 2008 18:28:50 -0400 Subject: [PATCH] metaform calls email() correctly, and uses reply_to field --- metaform/template.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/metaform/template.php b/metaform/template.php index e62b1d7..a0b657f 100644 --- a/metaform/template.php +++ b/metaform/template.php @@ -141,19 +141,19 @@ function _~form_name~_main() { } if($GLOBALS['~form_name~_form_recipient'] != "fixme@example.com") { $to = $GLOBALS['~form_name~_form_recipient']; + $from = $to; + $reply_to = ''; if(isset($_REQUEST['email']) and valid_email($_REQUEST['email'])) { - $from = $_REQUEST['email']; + $reply_to = $_REQUEST['email']; if($_REQUEST['name'] and ereg('^[a-zA-Z0-9_\' -]*$', $_REQUEST['name']) !== false) { - $from = "$_REQUEST[name] <$from>"; + $reply_to = "$_REQUEST[name] <$reply_to>"; } - } else { - $from = $to; } $subject = '~form_name~ form submitted'; $message = tem_run('~form_name~.email.txt'); $cc = ''; $bcc = ''; - if(email($from, $to, $subject, $message, $cc, $bcc)) { + if(email($from, $to, $subject, $message, $reply_to, $cc, $bcc)) { message('Due to an internal error, your message could not be sent. Please try again later.'); $error = true; } -- 1.7.10.4