Index: onw_simple_contact.php =================================================================== --- onw_simple_contact.php (revision 365326) +++ onw_simple_contact.php (working copy) @@ -49,6 +49,7 @@ var $admin_opt_page = 'onwscf'; var $admin_opt_url; var $email = ''; + var $from_email = ''; var $subject = ''; var $recaptcha = false; var $recaptcha_theme = 'red'; @@ -78,6 +79,7 @@ $options = $this->back_compat_1($options); } $this->email = isset($options['email']) ? $options['email'] : $this->email; + $this->from_email = isset($options['from_email']) ? $options['from_email'] : $this->from_email; $this->subject = isset($options['subject']) ? $options['subject'] : $this->subject; $this->recaptcha = isset($options['recaptcha']) ? $options['recaptcha'] : $this->recaptcha; $this->recaptcha_theme = isset($options['recaptcha_theme']) ? $options['recaptcha_theme'] : $this->recaptcha_theme; @@ -117,6 +119,7 @@ if(!is_multisite()){ $options = array( 'email' => $this->email, + 'from_email' => $this->from_email, 'subject' => $sub, 'recaptcha' => $this->recaptcha, 'recaptcha_theme' => $this->recaptcha_theme, @@ -134,6 +137,7 @@ } else { $options = array( 'email' => $this->email, + 'from_email' => $this->from_email, 'subject' => $sub, 'recaptcha_theme' => $this->recaptcha_theme, 'top_text' => $tt, @@ -159,6 +163,7 @@ } else { $options = array( 'email' => $this->email, + 'from_email' => $this->from_email, 'subject' => $sub, 'recaptcha' => $this->recaptcha, 'recaptcha_theme' => $this->recaptcha_theme, @@ -219,6 +224,7 @@ // update the options with the new values $this->email = $_POST['to_email']; + $this->from_email = $_POST['from_email']; $this->subject = $_POST['def_subj']; if(is_super_admin()): $this->recaptcha = ( isset($_POST['recaptcha']) && $_POST['recaptcha'] == 'on' )? true: false; @@ -395,6 +401,20 @@ + + +  
+ + + + + @@ -759,9 +779,16 @@ $replace_with = array($onw_inputs['name'],$onw_inputs['email']); $onw_subject = str_replace($look_for,$replace_with,$this->subject); - // Prepare the 'from' header w/ the input email - $onw_from = 'From: '.$onw_inputs['email']; + // Prepare the 'from' header w an email from the site to pass anti-spam checks + if ( is_email($this->from_email)) { + $onw_additionalHeaders = 'From: '.$this->from_email; + } else { + $onw_additionalHeaders = 'From: '.get_bloginfo('admin_email'); + } + // Prepare the 'reply-to' header w/ the input email + $onw_additionalHeaders .= 'Reply-To: '.$onw_inputs['email']; + // Prepare the 'to' variable. Uses the blog's admin email address if ( is_email($this->email) ) $onw_to = $this->email; @@ -769,7 +796,7 @@ $onw_to = get_bloginfo('admin_email'); // Prepare the indexed array to be returned by inserting the variables... - $return_info = array($onw_to, $onw_subject, $onw_body, $onw_from); + $return_info = array($onw_to, $onw_subject, $onw_body, $onw_additionalHeaders); // And return the array. return $return_info;