I am also tring to do a simalar thing.
I want to send a HTML email, but the HTML is has some veriabels that the user will type in.
I have the following written, but I want the message to br HTML and include the variables, eg to_email.
Any ideas?
Basket
<?php
$from_email;
$from_name;
$to_email;
$to_name;
$today = date(" l, F j, Y");
$subject = "ePost Card from extremeironing.com";
$message = "<B>Basket was here</B>";
/ additional header pieces for errors, From cc's, bcc's, etc /
$headers .= "From: $from_email\n";
$headers .= "X-Sender: $from_email\n";
$headers .= "X-Mailer: PHP\n"; // mailer
$headers .= "Return-Path: $from_email\n"; // Return path for errors
/ If you want to send html mail, uncomment the following line /
$headers .= "Content-Type: text/html; charset=iso-8859-1\n"; // Mime type
// is the $from email address in valid format?
if(ereg("([[:alnum:].-]+)(@[[:alnum:].-]+.+)", $from_email))
{
//send mail
mail($to_email, $subject, $message, $headers);
// redirect to sent page
header("Location: ./sent.php");
}
else
{
// redirect to problem page
header("Location: ./problem.php");
}
?>