Please help ... I am rather new on php coding, I need some help regarding html rich mail... IThis is the output i am getting
<html><head><title>email message</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><img src="/images/logo.jpg" />Dear Gilbert Thank you so much for visiting our stand at The Bridal Expo.
This is my script
<?php
session_start();
ob_start();
// Get values from form
$name = $_SESSION['name'];
$surname = $_SESSION['surname'];
$function_date = $_SESSION['function_date'];
$telephone = $_SESSION['telephone'];
$details = $_SESSION['details'];
$email = $_SESSION['email'];
/* Set e-mail recipient */
$myemail = "
[email protected]";
$myemail2 = "
[email protected]";
echo "email page";
/* Check all form inputs using check_input function */
$yourname = check_input($name, "Enter your name");
$subject = "Thank you for your response";
$subject2 = "Response";
//$email = check_input($email);
$comments = "Write your comments";
/* If e-mail is not valid show error message */
if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $email))
{
show_error("E-mail address not valid");
}
/* If URL is not valid set $website to empty */
if (!preg_match("/^(https?:\/\/+[\w\-]+\.[\w\-]+)/i", $website))
{
$website = '';
}
/* Let's prepare the message for the e-mail */
$message = '<html><head><title>email message</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">';
$message .= '<img src="/images/logo.jpg" />';
$message .= "Dear $yourname
Thank you so much for visiting our stand at The Bridal Expo.
Please feel free to contact us for an appointment or if you have any questions regarding your wedding garments.
Details Inserted
------------------
Name: $name
Surname: $surname
E-mail: $email
Function Date: $function_date
Telephone: $telephone
Kind Regards
Sanette Van Schalkwyk
0794960747
http://www.shiftingsands.co.za
</body></html>
";
/* Let's prepare the message for the e-mail */
$message2 = "Hello
Feedback received
Name: $name
Surname: $surname
E-mail: $email
Function Date: $function_date
Telephone: $telephone
End of message
";
/* Send the message using mail() function */
mail($email, $subject, $message);
mail($myemail, $subject2, $message2);
mail($myemail2, $subject2, $message2);
/* Redirect visitor to the thank you page */
header('Location: ../thankyou.php');
exit();
/* Functions we used */
function check_input($data, $problem='')
{
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
if ($problem && strlen($data) == 0)
{
show_error($problem);
}
return $data;
}
function show_error($myError)
{
?>
<html>
<body>
<b>Please correct the following error:</b><br />
<?php echo $myError; ?>
</body>
</html>
<?php
exit();
}
?>