Thanks Yelvington. Yes, I did read the manual page for the mail() function, but I didn't see an example that shows including form results in the mail.
I took a stab at it, but obviously something's not right. What I get is that the confirmation page shows that it's been sent. I do receive it, but it just displays all of the html code defined in $msg, plus it displays this below the code:
From: Me
Reply-To: me@me.com
MIME-Version: 1.0
Content-type: text/html; charset=iso-8859-1
Here's the code I used.
<?
$to = "me@mydomain.com";
$sender_name = $name;
$sender_email = $email;
$subject = "Testing PHP HTML Mail Form Results";
$mailheaders = "From: $sender_name\n";
$mailheaders .= "Reply-To: $sender_email\n\n";
$mailheaders .= "MIME-Version: 1.0\n";
$mailheaders .= "Content-type: text/html; charset=iso-8859-1\n";
$msg = '<html>
<head>
<style type="text/css">
body {font-family: verdana; font-size: 10pt}
</style>
</head>
<body>
<form method="POST" name="form1" action="html_mail_test.php">
<p>Name: <input type="text" name="name" value=$sender_name size="20"></p>
<p>Email: <input type="text" name="email" value=$sender_email size="30"></p>
<p>Session: I<input type="checkbox" name="session1" value=$session1>
II<input type="checkbox" name="session2" value=$session2> III<input
type="checkbox" name="session3" value=$session3></p>
<p><input type="submit" value="Submit" name="B1"><input type="reset"
value="Reset" name="B2"></p>
</form>
</body>
</html>';
mail($to, $subject, $mailheaders, $msg);
?>
<html>
<head>
</head>
<body>
<?
echo "<p>Mail has been sent!</p>";
?>
</body>
</html>
Any ideas? 🙁
Thanks!