Code is below. I want it to separate the [From: xxxxxx] part so the rest of the body/message appears on a different line.
<?php
$name = $_POST["name"];
$email = $_POST["email"];
$message = $_POST["message"];
$recipient = "me@christianselig.com";
$subject = "Message From Website";
$body = "[From: " . $name . "]\n\n" . $message;
$headers = "From: " . $email . "\r\n";
$headers .= "Content-type: text/html; charset=UTF-8" . "\r\n";
$success = mail($recipient, $subject, $body, $headers);
echo $success;
?>
You should use the HTML tag
<br />instead of\nLike this:
And a suggestion using the
mail()function:EDIT 1
As you are trying to send as plain text you should use
\r\n, this is the escape sequence for new line in plain text. Example: