I am using the below code to send comments entered onto my website. The code is working correctly but the format of the message is not write. I have pasted the code and a copy of the email I receive below. As you can see all text after the first line is tabbed.
Does anyone know what I have done wrong?
Code: Select all
<?php
$Title = $_POST['Title'];
$FirstName = $_POST['FirstName'];
$LastName = $_POST['LastName'];
$Email = $_POST['Email'];
$Comments = $_POST['Comments'];
$strMailTo = 'Edgar@rrbltd.com';
$strSubject = 'Enquiry from Website';
$strBody = "Enquiry received from http://www.rrbltd.com \n
$Comments \n
Received from \n
$Title $FirstName $LastName \n
$Email";
$From = "From: \"$FirstName $LastName\" <$Email>\nX-Mailer: PHP/" . phpversion();
mail ($strMailTo, $strSubject, $strBody, $From);
?>TIA
Enquiry received from http://www.rrbltd.com
Thsi is a test comment
Received from
Mr Edgar Thoemmes
ethoemmes@gmail.com