Big Brothers, Please kindly help me out on this....
I assigned values to a series of variables.
I tried to read out these values with linebreaks, but the line breaks aren't working as expected.
I am sending a mail to an address:
The problem is, if I check the mail, the mail object does not strip-format the linebreaks. It adds the linebreaks together with the values.
Pls see the code below:
Thank you.
I assigned values to a series of variables.
I tried to read out these values with linebreaks, but the line breaks aren't working as expected.
I am sending a mail to an address:
The problem is, if I check the mail, the mail object does not strip-format the linebreaks. It adds the linebreaks together with the values.
Pls see the code below:
Code:
<?php
if (empty($_POST) === false) {
$errors = array();
$name = $_POST['name'];
$email = $_POST['email'];
$mess = $_POST['description'];
$cname=$_POST['company'];
$add=$_POST['address'];
$tel=$_POST['phone'];
$product=$_POST['prtype'];
$qty=$_POST['quantity'];
$comment=$_POST['comment'];
$message0 = "Customer Name: " . $name . "<br/>";
$message1 = "Company Name: " . $cname . "<br/>";
$message2 = "Company Address: " . $add . "<br/>";
$message3 = "E-mail Address: " . $email . "<br/>";
$message4 = "Telephone Number: " . $tel . "<br/>";
$message5 = "Product Type: " . $product . "<br/>";
$message6 = "Description: " . $mess . "<br/>";
$message7 = "Product Quantity: " . $qty . "<br/>";
$message8 = "Additional Comment: " . $comment . "<br/>";
$message=$message0 . $message1 . $message2 . $message3 . $message4 . $message5 . $message6 . $message7 . $message8;
if (empty($name)===true || empty($email) || empty($mess)===true || empty($cname)===true || empty($add)===true || empty($tel)===true || empty($product)===true) {
$errors[] = 'The Fields starred with red "*" are Required!';
} else {
if (filter_var($email, FILTER_VALIDATE_EMAIL) === false ) {
$errors[] = 'Please type in a valid Email-address';
}
if (empty($errors) === true) {
mail('info@multistreamoil.com', 'Subject', $message, 'From: ' . $email);
header('Location: successful.php?sent');
exit();
}
}
}
?>
Comment