Hello!
I have my mail script working.. It sends correctly to the box specified, all data is correctly passed both in the email and in the sql db. My question is about how to make the mail script print the name of the variable before the variable. Right now, when I get the email it looks like:
Joe Blow
joe@blow.com
I want it to look like:
Name: Joe Blow
Email: joe@blow.com
I am not sure how to do this, and the little things I have tried just break my script. Can anyone point me in the right direction?
Thanks 🙂
$from = "From: Form <fubar@tarfu.com>";
$to = "snafu@omfg.com";
$subject = " Form Results";
$body =
(
$_POST['name'] . "\r" .
$_POST['email'] . "\r" .
$email=$_POST['email'];
if(mail($to,$subject,$body,$from))
echo"Mail sent!"";
else echo "MAIL FAILED";