dan182skater Posted July 19, 2007 Share Posted July 19, 2007 Hello everyone! Quick question: I have a form that I made with phpFormGenerator and the processor.php file makes the form have this in the "From" field when it is sent to my email: Nobody [nobody@burgos.ourhostingservers.com] I'm not that good with PHP but can see from below that the email above is a default server email address for the hosting account I have and it is being retrieved from the PHP line below: $where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/")); How can I make the "From" field simple be an email address that I specify? THANK YOU!!!! Quote Link to comment Share on other sites More sharing options...
benjaminbeazy Posted July 19, 2007 Share Posted July 19, 2007 no that gives you the script path, not the from address. post the processor.php code plz Quote Link to comment Share on other sites More sharing options...
dan182skater Posted July 19, 2007 Author Share Posted July 19, 2007 processor.php <?php $where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/")); mail("dan182skater@gmail.com","MCWL New Member - Form submission","Form data: Name: " . $_POST['field_1'] . " Telephone: " . $_POST['field_2'] . " Email: " . $_POST['field_3'] . " Business Address: " . $_POST['field_4'] . " Address Line 2: " . $_POST['field_5'] . " City: " . $_POST['field_6'] . " State: " . $_POST['field_7'] . " Zip Code: " . $_POST['field_8'] . " Website: " . $_POST['field_9'] . " Areas of Practice: " . $_POST['field_10'] . " "); include("newmember_thankyou.html"); ?> Thanks! Quote Link to comment Share on other sites More sharing options...
benjaminbeazy Posted July 20, 2007 Share Posted July 20, 2007 try this... <?php $where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/")); $to = 'dan182skater@gmail.com'; $headers = 'From: webmaster@example.com' . "\r\n" . 'Reply-To: webmaster@example.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); $subject = 'MCWL New Member - Form submission'; $message = "Form data: Name: " . $_POST['field_1'] . " Telephone: " . $_POST['field_2'] . " Email: " . $_POST['field_3'] . " Business Address: " . $_POST['field_4'] . " Address Line 2: " . $_POST['field_5'] . " City: " . $_POST['field_6'] . " State: " . $_POST['field_7'] . " Zip Code: " . $_POST['field_8'] . " Website: " . $_POST['field_9'] . " Areas of Practice: " . $_POST['field_10']; mail($to, $subject, $message, $headers); include("newmember_thankyou.html"); ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.