Forum Moderators: coopster
I am trying to put up a simple contact form and use a php script to handle it. I have no knowledge of PHP at all so bear with me. The current script is.
<?
$ForwardTo="info@mydomain.com";
$email=$_REQUEST['email'];
$entry=$_REQUEST['phone'];
$subject=$_REQUEST['message'];
mail($ForwardTo, "Web Submission", $email, $phone, "From:info@mydomain.com");
header("Location: thankyou.html");
?>
I end up getting these e-mails fine but my form has a third text area named "message" but no matter what I add to the script to try to include the text in the "message" area the e-mail never makes it to me so I assume I am not setting up the script right.
My question is. What do I need to add to the above script so that the content of a third text area named message gets to me in the email created.
Thanks
<?php
$ForwardTo="info@mydomain.com";
$email=$_REQUEST['email'];
$entry=$_REQUEST['phone'];
$subject=$_REQUEST['message'];
mail($ForwardTo, "Web Submission", "$email\n\n$phone\n\n$subject", "From:info@mydomain.com");
header("Location: thankyou.html");
?>
The "\n\n" adds new lines to make the content of the email a little easier on the eye! ;)
PHPMailer is a better, all-round solution. [phpmailer.sourceforge.net...]