sammymaudlin Posted October 12, 2009 Share Posted October 12, 2009 I used a wizard to create a PHP email form. I was able to customize it with the exception of the From field. I need the email that is sent to be "From" the email that the sender input. Instead it comes "From" a nonexistent email address with "server" in the domain. Here is the processor code I'm using <?php $where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/")); mail("[email protected]", $_POST['field_3'], " First Name: " . $_POST['field_1'] . " Last Name: " . $_POST['field_5'] . " Email Address: " . $_POST['field_2'] . " Situation: " . $_POST['field_3'] . " Message: " . $_POST['field_4'] . " "); include("confirm.html"); ?> Any help would be greatly apprciated. Link to comment https://forums.phpfreaks.com/topic/177472-from-field-in-php-email-form/ Share on other sites More sharing options...
cags Posted October 12, 2009 Share Posted October 12, 2009 $to = "[email protected]"; $subject = $_POST['field_3']; $message = "First Name: " . $_POST['field_1'] . " Last Name: " . $_POST['field_5'] . " Email Address: " . $_POST['field_2'] . " Situation: " . $_POST['field_3'] . " Message: " . $_POST['field_4']; $headers = "From: " . $_POST['field_2'] . "\r\n"; mail($to, $subject, $message, $headers); Link to comment https://forums.phpfreaks.com/topic/177472-from-field-in-php-email-form/#findComment-935770 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.