Tagged: contact
-
AuthorPosts
-
January 15, 2014 at 7:11 pm #210214
I capture
‘Element: E-Mail’
With the built in contact form
Unfortunately this method sends the message on to ‘Your email address’ using ‘Element: E-Mail’ as sender
Can sender be changed to fixed address and element simply included in body?Reason: Hard code sender to bypass spam filter
January 16, 2014 at 12:47 am #210403Hi!
You can hard code that in framework/php/class-form-generator.php, line 664 and line 669:
$header .= 'From: '. $from . " <".$from."> \r\n";
Best regards,
JosueJanuary 16, 2014 at 1:03 am #210419OK so looking at those, and not really understanding what I am looking at:
foreach($copy as $send_to_mail) { if($use_wpmail) { $header .= 'From: '. $from . " <".$from."> \r\n"; wp_mail($send_to_mail, $subject, $message, $header); } else { $header .= 'From:'. $from . " \r\n"; mail($send_to_mail, $subject, $message, $header); } }
is my change something like:
foreach($copy as $send_to_mail) { if($use_wpmail) { $header .= 'From: '. (Email address hidden if logged out) . " <".$from."> \r\n"; wp_mail($send_to_mail, $from, $subject, $message, $header); } else { $header .= 'From:'. (Email address hidden if logged out) . " \r\n"; mail($send_to_mail, $from, $subject, $message, $header); } }
- This reply was modified 10 years, 11 months ago by aribann.
January 16, 2014 at 1:07 am #210424Hi!
This would be the code:
foreach($copy as $send_to_mail) { if($use_wpmail) { $header .= 'From: (Email address hidden if logged out) < (Email address hidden if logged out) > \r\n'; wp_mail($send_to_mail, $from, $subject, $message, $header); } else { $header .= 'From: (Email address hidden if logged out) \r\n'; mail($send_to_mail, $from, $subject, $message, $header); } }
Regards,
JosueJanuary 16, 2014 at 1:10 am #210426Brilliant
Many thanksJanuary 16, 2014 at 1:18 am #210433You are welcome, glad we could help :)
Regards,
JosueJanuary 16, 2014 at 1:24 am #210434Oddly
Subject is received as what the user enters as their email address
and
From WordPress < (Email address hidden if logged out) >
and
the body of the message is what the contact form has hard coded as the subjectso its close
January 16, 2014 at 5:11 am #210465Ok learned this
By default, the WordPress mailer fills in the From: field with (Email address hidden if logged out) and the From: name as WordPress.
-
AuthorPosts
- The topic ‘Contact Form – Change Sender to Fixed Value and Retain captured Element’ is closed to new replies.