Send Form Contents to E-Mail

I took the time to do this post because I see a lot of students looking everywhere for a PHP E-Mail script, so here it is:

//Created byξGilbertoξCortez http://www.gilbertocortez.com

//Variables

$form = ???Contact Us???;//Form Name

//Inputs From Form

$name = $_POST[‘name’];

$email = $_POST[’email’];

$phone = $_POST[‘phone’];

$city = $_POST[‘city’];

$comments = $_POST[‘comments’];

//E-Mail Headers

$headers = ???From:???.$email. ???\r\n???;//From E-Mail Header

$headers .= ???Cc:ξdebugg@email.com??? . ???\r\n???;//Debugging E-Mail

$to = ???your@email.com???;//To Address

$subject = ???Message From ???.$form.??? Form???;//Subject Line

//Actual E-Mail Message

$message = ???You received a message from the form named: \???”.$form.???\???:

From: ???.$name.???

E-Mail: ???.$email.???

Phone #: ???.$phone.???

City: ???.$city.???

Comments: ???.$comments.???

???;

//Send E-Mail

mail($to,$subject,$message,$headers);

//Page Re-Direct

header (???Location: thankyou.html???);

Hope you like the script, I added notes to it for easier understanding. Just customize the variables up on top from the fields of your form and for your information. Also remember to add or remove them on the message itself if you change the number or name of the variables.

Any questions or comments are appreciated.

error

Enjoy this blog? Please spread the word :)