Hello, I am working on a email form, and I need to split each input into a separate line. Ex. the input $name would be on line one in the email, $email would be on line two, and so on. Here is my code that isn't working:
PHP Code:
<html>
<body>
<?php
/* This code here will mail off an email from the webform to ... */
/* These are the fields of the form. The ones with * need to be filled out.
name
email *
subject *
message *
check *
*/
$name=$_POST["name"];
$email=$_POST["email"];
$subject=$_POST["subject"];
$message=$_POST["message"];
$check=$_POST["check"];
$sendemailto="..."; // Who to send the email to
print $name;
print $email;
print $subject;
print $message;
print $check;
if ($email=="" or $subject=="" or $message=="" or $check==""){ // If any of these fields are equal to nothing, then
print "You have missed some fields. Go back and fill out all of the fields that have a * next to them.";
}elseif ($email!="" and $subject!="" and $message!="" and $check==...){
$message = "Name: " . $name "\n Email: " . $email "\n Subject: " . $subject "\n Message: " . $message ;
$headers = "From:" . $email;
mail($sendemailto,$subject,$message,$headers);
print "Email sent!";
}
?>
</body>
</html>