Hi
I am using aform generated with the phpformgenerator , it is a great script and thanks to the programer , it does really help.
the only thing I want to change is the email header .
In the "FROM" section it does show the server address and the domain name .
is there any way to change it to the person' s email address who sent the email ?
Thanks for your help
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2010-10-13
Hello,
Make to following change in processor.php:
Change this:
");
include ("confirm.html");
To this:
",$headers);
include ("confirm.html");
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The processor.php has the simplest implementation (example #1 in the link above) of the function and to accomplish what you want it is best to follow example #2 in the link above.
If you still have issues then come back and I will see if there is some other way of helping you accomplish what you want.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Im trying to do the same thing, everything is working fine, I just want to have the forms header to take the email from the email field of the form. This way I can just reply to the email and everything will work great.
My processor.php looks like this:
As you can see, the email is field_4. I know quite a bit of bash scripting but php is completely new to me. I tried for about 20-30 minutes to get it to work but couldnt. I think I just need to know how to use a variable for field_4 on this line: "$headers = 'From: webmaster@example.com' . "\r\n" ."
any help or input is greatly appreciated. And thank you to phpformgenerator, I will be donating!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
well that worked. thank you! although im still having an issue, when i reply it wants to send it to the email that it was sent to, not that it says its from. might be an issue with my email. i have the form sent to a website email, and that email is forwarded to a gmail account.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yeah, my gmail is the one with the issue, if I go to the domain email and hit reply it sets it up to send to email from the form. Once again, thanks for your help!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
I am using aform generated with the phpformgenerator , it is a great script and thanks to the programer , it does really help.
the only thing I want to change is the email header .
In the "FROM" section it does show the server address and the domain name .
is there any way to change it to the person' s email address who sent the email ?
Thanks for your help
Hello,
Make to following change in processor.php:
Change this:
");
include ("confirm.html");
To this:
",$headers);
include ("confirm.html");
Hi
Thanks for the reply , unfortunately I am still getting the Server' s name in the header of the email message !
If I may ask you about this line of code
.strrev(strstr(strrev($_SERVER),"/"));]
It looks to me to be responsible for my problem ???
Any way to change it with the email address of the sender ?
Sorry to bother you again, I really appreciate your help
Your processor.php file mail() function has a line that starts like this:
mail("email@url.com","phpFormGenerator - Form submission","Form data:
The PHP mail() function syntax is identified here:
http://www.php.net/manual/en/function.mail.php
The processor.php has the simplest implementation (example #1 in the link above) of the function and to accomplish what you want it is best to follow example #2 in the link above.
If you still have issues then come back and I will see if there is some other way of helping you accomplish what you want.
Im trying to do the same thing, everything is working fine, I just want to have the forms header to take the email from the email field of the form. This way I can just reply to the email and everything will work great.
My processor.php looks like this:
<?php
$where_form_is="http://".$_SERVER.strrev(strstr(strrev($_SERVER),"/"));
// File upload handling
if($_FILES!=''){
$field_12_filename = "file_12_".date("sihdmY").substr($_FILES,strlen($_FILES)-4);
if(!move_uploaded_file($_FILES, "./files/".$field_12_filename)){
die("File " . $_FILES . " was not uploaded.");
}
}
// File upload handling
if($_FILES!=''){
$field_13_filename = "file_13_".date("sihdmY").substr($_FILES,strlen($_FILES)-4);
if(!move_uploaded_file($_FILES, "./files/".$field_13_filename)){
die("File " . $_FILES . " was not uploaded.");
}
}
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail("jordan@xtrememaching.com","RFQ from xtrememachinc.com", "Form data:
Name: " . $_POST . "
Title/Position: " . $_POST . "
Company Name: " . $_POST . "
Email: " . $_POST . "
Phone: " . $_POST . "
Fax: " . $_POST . "
Have You Purchased From Us Before?: " . $_POST . "
Respond By Date: " . $_POST . "
Prefered Response: " . $_POST . "
Specifications: " . $_POST . "
Special Instructions: " . $_POST . "
Add A File: ".$where_form_is."files/".$field_12_filename." (original file name: " . $_FILES . ")
Add Another File: ".$where_form_is."files/".$field_13_filename." (original file name: " . $_FILES . ")
From Xtrememachinc.com
",$headers);
include("confirm.html");
?>
As you can see, the email is field_4. I know quite a bit of bash scripting but php is completely new to me. I tried for about 20-30 minutes to get it to work but couldnt. I think I just need to know how to use a variable for field_4 on this line: "$headers = 'From: webmaster@example.com' . "\r\n" ."
any help or input is greatly appreciated. And thank you to phpformgenerator, I will be donating!
$headers = 'From: '. $_POST . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
well that worked. thank you! although im still having an issue, when i reply it wants to send it to the email that it was sent to, not that it says its from. might be an issue with my email. i have the form sent to a website email, and that email is forwarded to a gmail account.
Yeah, my gmail is the one with the issue, if I go to the domain email and hit reply it sets it up to send to email from the form. Once again, thanks for your help!