Page 1 of 1

[Solved] Email format

Posted: Mon Sep 12, 2005 1:17 pm
by ethoemmes
Hi

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);

?>

Enquiry received from http://www.rrbltd.com

Thsi is a test comment

Received from

Mr Edgar Thoemmes

ethoemmes@gmail.com
TIA

Posted: Tue Sep 13, 2005 11:49 pm
by wyred
I think you need to use \t if you want tabs.