Sending HTML with variables!



Hello People

Currently I am practising with a PHP Comment Form. So people can send an email to the webmaster. What the plan is is that the user receives a confirmation that his email has been sent. And second, the webmaster will get an email. Now, I want to get these emails in HTML format.

I figured out how to activate HTML emails without using PEAR. But when I start using variables in this email the email plain copies the variables as they are: "$first_name $last_name wrote this comment: $comment".

So, no comments, no names, no nothing.

I have the code, but the variables are mostly in dutch. Hopefully you can see past 'em.

if (empty($errors)) {
		$body = "Bedankt voor je commentaar. Er wordt zo spoedig mogelijk contact met je opgenomen.";
		$email = $_POST['email'];
		$extra = "From: $email";
		$voornaam = $_POST['voornaam'];
		$achternaam = $_POST['achternaam'];
		$comment = $_POST['commentaar'];
		$message = '
		<html><head><title>Commentaar van $voornaam</title></head>
		<p><b>$voornaam $achternaam</b> heeft het volgende over je website gezegd:<br />
		/* To send HTML mail, set the Content-type header. */ 
		$headers  = "MIME-Version: 1.0\n"; 
		$headers .= "Content-type: text/html; charset=iso-8859-1\n"; 

		/* Additional headers */ 
		$headers .= "From: $email\n";
		$titel = "Commentaar van $voornaam";
		mail ($email, 'A Title For the mail', $body, 'From:');
		mail ('', $titel, $message, $headers);
		echo '<p>Your comment has been sent!</p>';

I translated some...
Thanks for reading.

Make it like this (example):

$message = '<html>
     <title>Commentaar van ' . $voornaam . '</title>
    <b>' . $voornaam . ' ' . $achternaam . '</b> heeft het volgende over je website gezegd:
    <br />
    <i>' . $comment . '</i>

Get it ?