FORM_BLOCK_SENDER_EMAIL
PermalinkI'm trying to get the forms block to use the user's email in the From field, and I have read that using FORM_BLOCK_SENDER_EMAIL in /config/site.php should help with this.
I'm just lost as to how to actually enable it. Basically i have
define('FORM_BLOCK_SENDER_EMAIL ','');
Any help would be appreciated, I know its probably something simple.
Cheers.
I found it mentioned here:http://www.concrete5.org/community/forums/customizing_c5/forms_emai...
I was hoping to get the actual email of the person submitting the form as the from email. I could be totally wrong with my understanding of what this constant does also!
so...
just create a dummy email called no-reply@youdomain.com
and put it in the constant
Thanks for the help.
suck a pain..
this how i solve this problem open:
concrete/block/form/controller.php
i change
$mh->from( $formFormEmailAddress );
to
$mh->from( $questionAnswerPairs[3]['answer'] );
if that array not match, try print_r
and remember, this will seting all your from block, since i just use form for 'contact page'
If you alter the core form block, it wont work when upgraded, so it would be better to duplicate the form block and do the necessary changes that you want to do.
Many thanks
Vijay
"and remember, this will seting all your from block, since i just use form for 'contact page'"
just move it
to /block/form
from /concrete/block/form
and why the FORM_BLOCK_SENDER_EMAIL must be the admin email, not the email that i put in block form options?
# special code to intercept contact us pages and set the FROM adddress properly if (!empty($_POST)) { # default to admin $final_email = 'no-reply@<your site here.com>'; # if we have something in Question3 (my email is question3) if ($_POST['Question3']) { $test_email = preg_replace("/[\r\n]/", '', $_POST['Question3']); # check to see if it's a valid email address if (eregi("^['_a-z0-9-]+(\.['_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,6})$", $test_email)) { # we passed the syntax check, let's check the dns records $host = ereg_replace(".*@", "", $test_email) . "."; if (getmxrr($host, $mxhosts) != false || gethostbyname($host) != $host ) { $final_email = $test_email; } }
define('FORM_BLOCK_SENDER_EMAIL ','youremail@here.com');
I am not familiar of this constant but I think you set it up like that, where did you find this constant mentioned?
Thanks