new to the forum and trying my hand at some coding to help out a friend who cant seem to get this right..
with that being said, i was originally having issues with the contact form on a website not being able to send an email. after a bit of searching on the net and adding a few components here and there it is finally working, but now i have an additional problem..
when the email gets sent through (this is a business website and it sends an email from there to the relevant sales department etc) its all shoved into one line and looks terrible..
like this-
"Name: TEST EMAIL FROM WEBSITETel: 011 937 0572Email: myemail@zmail.comMessage: TEST PLEASE CONFIRM
test 38"
what i have not been able to find is how to seperate the text so that it comes through in an email as seperate lines like this-
Name: Client
Tel: 011 000 0000
Email: myemail@zmail.com
Message: text here etc.
i have linked the contact form to a .php document, so i would presume that it is in this document that the change would need to take place?? i have tried to add in <br /> & <div>
but neither do anything except give me an error message when i try send form from the site.
here is the code for the contactgenie.php linked to the contact form that works 100%
<?php
$EmailFrom = "myeamail@zmail.co.za";
$EmailTo = "myemail@zmail.co.za";
$Subject = "Company Name - Online Enquiry";
$Name = Trim(stripslashes($_POST['Name']));
$Tel = Trim(stripslashes($_POST['Tel']));
$Email = Trim(stripslashes($_POST['Email']));
$Message = Trim(stripslashes($_POST['Message']));
// validation
$validationOK=true;
if (!$validationOK) {
print "There has been an error, please make sure you entered a correct email address."; // You can edit this to your own error message
exit;
}
// prepare email body text
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "";
$Body .= "Tel: ";
$Body .= $Tel;
$Body .= "";
$Body .= "Email: ";
$Body .= $Email;
$Body .= "";
$Body .= "Message: ";
$Body .= $Message;
$Body .= "";
// send email
$success = mail($EmailTo, $Subject, $Body, $Headers = "From: <$EmailFrom\r\n");
// redirect to success page
if ($success){
print "Thank you, your email has been sent! We will be in touch shortly!"; // You can edit this to your own success message
}
else{
print "There has been an error, please make sure you have entered your details correctly."; // You can edit this to your own error message
}
?>
any help with this would be greatly appreciated, thanks Dillon